in reply to Re^2: cleanly exiting threads
in thread cleanly exiting threads
The only absolutely foolproof way of doing it, is to create all threads at the beginning of the script, then REUSE the threads, over and over. See Reusable threads demo for the basic idea.
Otherwise, you may be best just turning off the warning, and watch for weird glitches or memory gains as your script runs.
All I can say is good luck, because I have run into similar problems many times, and now immediately use sleeping reusable threads right from the start of design. I don't even consider detaching, as it almost always leads to memory gains unless you somehow reuse the thread's scalar namespace. Also spawning threads is pretty intensive, so you want to minimize it......reuse threads and join at exit.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: cleanly exiting threads
by JoeKamel (Acolyte) on Aug 17, 2008 at 07:01 UTC | |
by zentara (Cardinal) on Aug 17, 2008 at 12:05 UTC |