Boost logo

Boost :

From: Anthony Williams (anthony_w.geo_at_[hidden])
Date: 2007-03-20 16:59:57


"Peter Dimov" <pdimov_at_[hidden]> writes:

> Anthony Williams wrote:
>
>> I'd be willing to help with a Boost.Pthread layer. I would be
>> concerned about layering Boost.Thread on Boost.Pthread, since that
>> seems to me to be too many abstractions. However, if we can make
>> Boost.Thread and Boost.Pthread share stuff under the covers, that
>> would be neat.
>
> Since the Boost.Thread (and N2184) underlying model is essentially
> equivalent to pthreads, one easy way to make Boost.Thread and Boost.Pthread
> share stuff is to make Boost.Thread use the pthread_* functions. :-)
>
> Perhaps you have in mind an intermediate common API? What would we gain from
> it?

For a non-pthreads platform, it might make sense to implement pthreads in
terms of the C++ interface, which is implementes in terms of the native API,
rather than implement the C++ interface in terms of pthreads, which is then
implemented in terms of the native API.

Lets take call_once, for example. PThreads only allows a real function with no
parameters returning void as the once function. This is relatively easy to
implement on top of a C++-style call_once that allows arbitrary function
objects with parameters, whereas it is much harder to do the reverse.

Anthony

-- 
Anthony Williams
Just Software Solutions Ltd - http://www.justsoftwaresolutions.co.uk
Registered in England, Company Number 5478976.
Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

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