Boost logo

Boost :

From: Anthony Williams (anthony.williamsNOSPAM_at_[hidden])
Date: 2002-10-17 08:20:50


David Abrahams writes:
> <anthony.williamsNOSPAM_at_[hidden]> writes:
>
> > David Abrahams writes:
> > > I suggest the following simple rewrite:
> > >
> > > "An object [1.8, 1.9] is accessible from multiple threads
> > > if it is of static storage duration (static, extern) [3.7.1],
> > > or if a pointer or reference to it is accessible from multiple
> > > threads."
> > >
> > > End of story.
> >
> > Except that it isn't --- the pointers and references need not
> > themselves be accessible from multiple threads for the pointed- or
> > referred-to object to be accessible from mutlple threads, if the
> > pointers or references are _copies_ of values accessible from
> > multiple threads.
>
> Fair enough. Yep, this wording is hard to get right. Got a suggestion?

Actually, I'm inclined to think that your wording is right after all. To get a
pointer or reference which is not itself accessible from multiple threads, but
points/refers to an object that is, you have to copy/take the address
of/dereference another pointer or reference which _is_ accessible from
multiple threads. The only exception is data which is passed into a thread by
the OS thread API, which is therefore only data from the thread object ---
everything else follows from there.

How about adding a "Note --- this includes pointers or references contained in
the boost::thread object used to start the thread and it's threadfunc"?

Anthony

-- 
Anthony Williams
Senior Software Engineer, Beran Instruments Ltd.
Remove NOSPAM when replying, for timely response.

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