Boost logo

Boost :

Subject: Re: [boost] [sync] [thread] Faster mutex
From: Tim Blechmann (tim_at_[hidden])
Date: 2015-01-30 22:50:02

>> Just curious, maybe ideas from Mesa's mutex could be useful for some of the
>> Boost libraries.
> I believe Vicente's current plan is that v5 Boost.Thread will extend
> the C++ 11 STL. Therefore boost::mutex would be implemented using
> std::mutex in v5 with the extensions Boost.Thread provides over the
> STL.
> Besides, last time I looked any STL mutex was already implemented
> using an atomic fastpath and lazy kernel wait object allocation after
> a spin. The win32 critical section has been that design since year
> dot.

hmm, last time i checked libc++ and libstdc++ both used pthread_mutex_t.
so i'd expect futex-based mutexes to perform better, as the pthreads
layer is not required and some pthreads functionality
(pthread_mutexattr_t) won't get into the code paths.

so futex-based mutexes would actually be quite reasonable ...


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