Boost logo

Boost :

From: williamkempf_at_[hidden]
Date: 2001-08-15 19:32:15


--- In boost_at_y..., "Alexander Terekhov" <terekhov_at_d...> wrote:
>
> > I note the clever semantics: this call would have to
> > throw an exception if the thread had been detached.
> > But there's no call to detach a thread, so it cannot happen:
> > threads are detached simply by not calling join.
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> really? without ref.counting? i do not understand this.
> can you explain this?

Unfortunately, to implement this correctly on top of pthreads I think
we're going to have to ref-count. Not in the same manner as you do
with a thread_ref concept, but it's still going to need to be done.
The biggest problem I see to getting this right is in not knowing
precisely what POSIX defines as the result of calling join() on a
thread that's already been joined or detached. If it's undefined
behavior then I'm going to have problems with "adopted" threads.
We'll have to discuss what the appropriate design/implementation will
be in that case. Can you enlighten me on this issue?

Bill Kempf


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk