|
Boost : |
From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2001-07-02 11:09:54
> > > void foo()
> > > {
> > > thread thrd(&bar);
> > > }
> >
> > Question: can a thread run without a corresponding thread object?
>
> Yes. This is a "detached" thread.
NO. A thread can not run without corresponding thread object.
it is just like "running" without thread stack / priority / other
thread identities. "detached" means that that thread object will
be destroyed/reclaimed _automatically_ on thread termination.
in the example above "detach" does not make sense, IMHO.
instead, pre-destructor should join and destructor should reclaim
other resources..
regards,
alexander.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk