RE: [boost] Thread: Why is my prog aborting after 283 or so threads?

Thanks again Caleb. A question for the designers of Boost::thread: Would it be possible for the thread library to have functionality added so that the thread itself can call a function like 'join' that releases all its resources? This would simplify my program a lot, and I suspect other applications as well. Tim -----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Caleb Epstein Sent: Monday, November 29, 2004 3:43 PM To: boost@lists.boost.org Subject: Re: [boost] Thread: Why is my prog aborting after 283 or so threads? On Mon, 29 Nov 2004 15:24:07 -0500, Tim Laplaca <tlaplaca@voiceglo.com> wrote:
Can you post your code to the list?
Gladly. See attached. Basically I just abandoned the thread_group and am calling thread::join after the sleep call. -- Caleb Epstein caleb dot epstein at gmail dot com

On Wed, 1 Dec 2004 09:28:41 -0500, Tim Laplaca <tlaplaca@voiceglo.com> wrote:
Thanks again Caleb.
A question for the designers of Boost::thread: Would it be possible for the thread library to have functionality added so that the thread itself can call a function like 'join' that releases all its resources? This would simplify my program a lot, and I suspect other applications as well.
You can make a thread non-joinable, in which case it will automatically clean up after itself, by deleting the heap-allocated thread objects you create. The thread will continue to run, but it will become "detached" and you won't face this resource issue on thread exit. -- Caleb Epstein caleb dot epstein at gmail dot com
participants (2)
-
Caleb Epstein
-
Tim Laplaca