I have a program that spawns off threads that listen for tcp connections & respond to them appropriately. After I create the pthread, the program continues execution to the return, then exits. I've stopped that by putting a simple cin >> some_char; before the final return, but is there a better way to get the program to stop before it returns without requiring any resources... like a sleep(FOREVER) or something similar?