In case of event driven programs, i usually don't want to do anything in the main thread (except init, and start the other threads ofc). The problem is, that the program exits when the main function ends.
I usually do a while(true) Sleep() to make the main function go on forever, but that's not quite... elegant. Is there a proper solution for this problem?
Name:
Anonymous2007-11-01 8:37
pthread_join (or equivalent operation) the other threads before returning. This will block the main thread until all other threads die.
Name:
Anonymous2007-11-01 8:43
waitUntilFinished() in that disgusting coffee language.