Subject: Re: [boost] [sync] [thread] Faster mutex
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2015-02-02 03:54:24
On Friday 30 January 2015 18:09:40 Antony Polukhin wrote:
> One of the Mesa developers implemented a faster mutex:
> According to the sources of glibc, Mesa's mutex has a much smaller size
> (only 1 uint32_t vs 6 ints + 2 pointers), performs less actions before and
> after the actual syscall (no getting and setting of the
> mutex->__data.__owner, no type field checks)
> This gives an ~10% speedup.
> Just curious, maybe ideas from Mesa's mutex could be useful for some of the
> Boost libraries.
I do have plans on implementing futex-based mutex and condition variable, but
it's not my top priority. I think the first release of Boost.Sync will be
based on pthread. Also, I've not decided if the futex-based implementation
should be provided as an alternative since in some situations it might be
needed to have access to the underlying primitives such as pthread_mutex_t.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk