|
Boost : |
From: Tim Laplaca (tlaplaca_at_[hidden])
Date: 2004-12-02 09:26:11
Good idea, thanks!
-----Original Message-----
From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]] On Behalf Of Bruno Martínez Aguerre
Sent: Wednesday, December 01, 2004 8:46 PM
To: boost_at_[hidden]
Subject: [boost] Re: Thread: Why is my prog aborting after 283 or so threads?
Just use an auto variable:
// some code
{
boost::thread t(&some_proc);
} // thread detached
// more code
Bruno Martínez
On Wed, 1 Dec 2004 17:10:57 -0500, Caleb Epstein <caleb.epstein_at_[hidden]>
wrote:
> On Wed, 1 Dec 2004 16:29:59 -0500, Tim Laplaca <tlaplaca_at_[hidden]>
> wrote:
>> I would have never thought of that, sounds dangerous! I tried it and it
>> seems to work though. Is that pretty safe?
>
> 100% safe. See the discussion here:
>
> http://boost.org/doc/html/thread.html#threadconstruct-copy-destruct
>
> That said, it might be nice to have an argument to the boost::thread
> ctor to start a detached thread w/o needing to resort to using the
> heap.
>
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk