
"Peter Dimov" <pdimov@mmltd.net> 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