Boost logo

Threads-Devel :

Subject: Re: [Threads-devel] pthreads_rwlock vs shared_mutex
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2014-02-03 13:32:59


Le 03/02/14 18:33, Nathan Rosenblum a écrit :
> Apologies if this is a question that gets asked ad nauseum on this
> list, but why is the shared_mutex implementation not a wrapper for
> pthread_rwlock on pthreads-based systems? I observe significantly
> better performance under concurrent reader access when using the
> pthreads implementation compared to acquiring a reader lock on
> shared_mutex, particularly on OSX where the cost of a contended
> pthread_mutex is extremely high (a short-hold, high-utilization,
> mostly-read shared_mutex on that platform effectively serializes access).

Hi,

I guess that either no body have tried it or there is something on the
features provided by shared_mutex that can not be implemented using
directly pthread_rwlock.
Maybe you can request directly to Howard Hinnant wrote the reference
implementation on which boost::shared_mutex is based.

I don't know if you have time to try an implementation using
pthread_rwlock, but if you reach and the performances are better there
is no reason to don't include it in Boost.

Best,
Vicente


Threads-Devel list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk