Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2001-06-27 07:54:05


At 08:03 AM 6/27/2001, Peter Dimov wrote:

>From: "Greg Colvin" <gcolvin_at_[hidden]>
>
>> I think I like it, but I'm not seeing an easy way to
>> create a thread object that goes away when the thread
>> exits.
>
>Could I venture a guess that there is none?
>
>The 'thread' concept, as currently designed (if I understand it
correctly,)
>simply cannot be represented by a C++ class well. Its lifetime doesn't
>correspond to C++ rules, where usually the creator of an object has
>explicit
>control over the object's lifetime.
>
>Why not use something like
>
>namespace thread
>{
> class id; // or 'desc', if you like
>
> id create(...);
>
>// etc
>};

Yes, that sort of low-level interface is the fallback if we can't work out
a "spirit of C++" interface.

While I'm really pressing to see if it is possilbe to develop a high level
interface, I'm not opposed to making the lower level interface public, just
as the C++ standard supports both <cstdio> and <iostream>.

--Beman


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