Date: Fri, 07 Jan 2005 18:46:05 -0000 From: "Niall Douglas" <s_sourceforge@nedprod.com> To: freebsd-threads@freebsd.org Subject: Re: higher speed mutexes Message-ID: <41DED8ED.32740.96446B0@localhost> In-Reply-To: <41DD68DB.6040405@he.iki.fi> References: <41DD04FE.7070409@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41DED8ED.32740.96446B0>