in reply to Re^2: panic: regfree data code 'ð' during global destruction. error when joining threads
in thread panic: regfree data code 'ð' during global destruction. error when joining threads
You can't exit the main thread without exiting all threads. If you need the behavior where the children continue on after the parent dies, you need "fork and exec", not threads.
If you just want to make sure all threads finish , at the end of your main program put something like
that should wait for all threads to finish. Remeber, a thread cannot be joined unless it returns or hits the end of it's code block. In an emergency, you can use the fact that calling "exit" from any thread, will kill all threads.while (threads->list()) { $_->join() foreach threads->list(threads::joinable); sleep(1); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: panic: regfree data code 'ð' during global destruction. error when joining threads
by somekindafreak (Acolyte) on Jun 11, 2008 at 23:59 UTC | |
by zentara (Cardinal) on Jun 12, 2008 at 13:42 UTC |