Boost logo

Boost :

From: Darryl Green (green_at_[hidden])
Date: 2001-06-28 20:56:26


Is it really the intent that self should return a "native" thread
id as described in:

-----Original Message-----
From: John Max Skaller [mailto:skaller_at_[hidden]]
Sent: Friday, 29 June 2001 6:59 AM
To: boost_at_[hidden]
Subject: Re: [boost] Re: Boost.Threads - thread_desc concept

> ...
>> 1) Will other operations that can be performed on threads create a
>> very real need for a self() method?
>
> Of course. [I'd call it 'get_native_id()']
-----

I would have thought that a facility to get the native thread id
associated with a boost::thread would be in the detail:: namespace
somewhere. I was expecting the static thread::self() to return a
boost:thread?
If there really is nothing sensible that a thread can do using its
own boost::thread (which looks like the case given the currently
proposed interface(s)) there isn't much point in having self() at
all. A self() that returns a native thread id, because there are
useful things a thread can do with that, suggests to me that the
the scope of the design being considered is too narrow and needs
to include how to deal with other threading issues in a platform
independent way. Alternatively, if the sole use of the
boost:thread library is for the "spawn a worker and either forget
about it or wait for it to terminate" model, there are going to be
an awful lot of C++ users (including me) who are going to conclude
that something else (raw pthreads or ACE being the most obvious
alternatives) is the answer.

Darryl Green.


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