Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2007-03-26 15:38:40


On Mar 26, 2007, at 3:04 PM, Peter Dimov wrote:

> I don't know if you remember it, but a while ago I tried to convince
> you
> that an N2178 handle is conceptually a lower level primitive than an
> N2184
> thread.

Yeah, it was burned into my brain. :-) Just kidding around, really! :-)

> This is extremely hard to sell to someone who has the
> implementations of
> both before his eyes and can plainly see that implementation-wise,
> N2184::thread is closer to pthread_t than N2178::handle.
>
> But if you consider both on an abstract level, it's easier to
> accept. An
> N2184 thread can be built on top of an N2178::handle by just
> wrapping it and
> disabling copyability. And an N2178::handle is obviously more
> powerful and
> more unsafe, as opposed to N2184::thread which is simplified and
> safer.

This just leaves me with the feeling of implementing unique_ptr in
terms of shared_ptr, at least on a pthreads platform. I understand
that on a Windows platform one can get the opposite feeling.

When it comes right down to it, we have two valid and reasonable OS
threading models before us:

1. pthreads
2. Windows

Which one do we model with std::thread (or std::thread::handle)?

N2184 chose pthreads and N2178 chose Windows (to be fair, N2178 chose
Windows with some pthreads mixed in).

-Howard


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