Boost logo

Boost :

From: Dave Abrahams (dave_at_[hidden])
Date: 2003-02-05 15:27:10


On Wednesday, February 05, 2003 3:04 PM [GMT+1=CET],
William E. Kempf <wekempf_at_[hidden]> wrote:

> > What I would like to see is a new boost::thread implementation which
> > meets the following requirements.
> >
> > a. There shall be two interfaces to a thread. One for creation of a
> > thread, from
> > here on called boost::thread. And, one for the created thread, from
> > here on called boost::thread::self.
>
> Self? Why? If it's on operation that can *only* be made on the current
> thread, then a static method is a better approach. Otherwise, I could
> make a "self" instance and pass it to another thread, which could then
> attempt an operation that's not valid for calling on another thread.

It would seem to me that, given the availability of p->yield() as a syntax
for invoking a static function, it'd be better to use a namespace-scope
function to avoid errors and for clarity.

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

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