in reply to threads - memory grow large
So what you need to do, is NOT detach, and work out a scheme to reuse your thread threads. I usually put them in a "sleeping condition", and have them periodically check to see if they should wake up and do something. It dosn't use much cpu for a thread to sleep and wake up every 50 milliseconds( or even 1 second).
You may also be able to use detach , but just reuse the variable name you assign to the thread, but I havn't tested that much. All this is complicated by what you are using in your thread. Try to keep all extra objects contained completely within each thread. But it is all so complex, that you really need to show some code example, then we can help you work out solutions.
|
|---|