Boost logo

Boost :

From: Anthony Williams (anthony_w.geo_at_[hidden])
Date: 2007-03-20 12:12:17

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

> Anthony Williams wrote:
>> Howard Hinnant <hinnant_at_[hidden]> writes:
>>> On Mar 19, 2007, at 5:29 PM, Sohail Somani wrote:
>>>> I was pretty much hoping for boost threads + cancellation.
>>> Fwiw, this is the approach of N2184:
>> For which I have now uploaded my Windows (MSVC) implementation to my
>> website:
> I take this to mean that you aren't interested in adopting any parts on
> N2178 as part of Boost.Threads. :-/

No, I just wanted to get my implementation out there for user feedback.

My implementation isn't quite N2184. I've got a templated thread::create
function (like N2178) rather than a templated constructor, for starters.

On rereading N2178, I just spotted that your call_once has the flag as the
first parameter, and allows additional arguments to be passed to the
once_function. I like that, and might change my library to match.

My focus is primarily on the C++ interface. I am concerned about the cost for
implementors of requiring pthreads as the C api, but am not opposed in
principle. Certainly, I think a boost.pthread-win32 library would be of

As for copyable handles, my implementation is deliberately not copyable, and
it would be trivial to convert it to be a copyable handle rather than just
movable. If the consensus of opinion of the committee is for copyable handles,
I'm happy to go with that for boost.

I find it strange to template the condition var on the mutex, and then
(separately) template the wait function on the lock type. I've opted for
templating the whole condvar on the lock type, as it seems more coherent to

Thread and mutex attributes are not currently something I've put much thought
into. Though I've made some comments about priority to the committee, I tend
to use default attributes in most cases.

Are there any crucial differences between N2178 and N2184 that I've missed?


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

Boost list run by bdawes at, gregod at, cpdaniel at, john at