higher speed mutexes

Niall Douglas s_sourceforge at nedprod.com
Fri Jan 7 10:46:39 PST 2005


On 6 Jan 2005 at 18:35, Petri Helenius wrote:

> > because we use simple mutex to protect rwlock, if simple mutex is
> > improved, rwlock should be improved by this side effect.
> >
> But rwlock will be significantly more expensive than a simple mutex
> when uncontested, right?

I have a highly optimised rwlock mutex implementation at 
http://svn.berlios.de/viewcvs/tnfox/trunk/src/FXThread.cxx?rev=52&view
=markup. If uncontested, it requires no more than a variable 
increment and a TLS variable increment (with corresponding complexity 
for unlocking) for read locking and four variable increments, three 
variable stores, one TLS variable read for write locking. It's also 
fully recursive.

Cheers,
Niall





More information about the freebsd-threads mailing list