Boost logo

Boost :

From: williamkempf_at_[hidden]
Date: 2001-09-17 10:57:55


--- In boost_at_y..., "Peter Dimov" <pdimov_at_m...> wrote:
> From: <williamkempf_at_h...>
> > --- In boost_at_y..., "Ed Brey" <edbrey_at_y...> wrote:
> > > I'm confused by this. Your documentation for join says that the
> > > only effect is to block.
> >
> > No, it says more than this. It says that all resources are
> > reclaimed. Reading the current documentation I see that the
wording
> > isn't specific enough to make clear what this means and I should
work
> > on it. One of the resources that's reclaimed is the "thread id".
> > This means that after a call to thread::join() all other
operations
> > are invalid on the thread object, the same as attempting to read
or
> > write to/from an fstream that's been closed.
>
> IOW join() invalidates the object. The only allowed operation is
> destruction. Everything else invokes undefined behavior.
>
> I can live with such a join. However I think that an equally viable
> alternative is a join() that doesn't invalidate. I don't see what
is gained
> by making access to a joined thread undefined behavior.

The only resource that could still be left around is the "thread id",
so the only operation that could still be valid is comparison. All
other operations would be invalid simply because there's no thread of
execution left on which to operate.

Bill Kempf


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