On May 25, 2005, at 10:41 PM, James Bigler wrote:
Hmm...looking at this some more there are some interesting things going on.
From what I understand main should not exit until all other threads have finished. The threading library tries to facilitate this by having the main thread block on a semaphore.
I ran into this problem when I wanted manta to "exit gracefully", meaning all the threads would in turn exit internally. If I use Thread::exitAll() it wouldn't have a problem. You can test this by pressing 'q' or ESC twice really fast (called fast quit in the code). This will force a call to Thread::exitAll(). Try this and see if you have this problem.
What I had to do for rtrt to exit gracefully properly (without segfaults), is to join all the worker threads to a single thread group. At the end of main() the main thread is joined to this group. main does not exit until all the worker threads have exited. Perhaps a similar model will help manta.
Manta does do this now...
Steve
Archive powered by MHonArc 2.6.16.