Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!newsfeed.straub-nv.de!newsfeed.pionier.net.pl!plix.pl!newsfeed1.plix.pl!news.nask.pl!news.nask.org.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail From: Edek Newsgroups: comp.programming.threads Subject: Re: Mutex or reader writer lock Date: Fri, 24 Jun 2011 12:02:54 +0200 Organization: ATMAN - ATM S.A. Lines: 23 Message-ID: References: <598410ca-ad1e-4f69-8d78-b22eda6bf1f3@f39g2000prb.googlegroups.com> NNTP-Posting-Host: 83-238-152-145.ip.netia.com.pl Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: node2.news.atman.pl 1308909723 13682 83.238.152.145 (24 Jun 2011 10:02:03 GMT) X-Complaints-To: usenet@atman.pl NNTP-Posting-Date: Fri, 24 Jun 2011 10:02:03 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Linux/3.1.0-15 Thunderbird/3.1.0 In-Reply-To: <598410ca-ad1e-4f69-8d78-b22eda6bf1f3@f39g2000prb.googlegroups.com> Xref: x330-a1.tempe.blueboxinc.net comp.programming.threads:363 On 06/24/2011 11:26 AM, ittium wrote: > >> >> Last time I checked (a couple of years ago), most POSIX rw-locks impls I >> have seen used mutexs and condition variables. They had rather horrible >> performance characteristics... > > Chris, I also did some more searching and it seems the rwlock > implementation is still based on mutex and condition variable and is > quite slow. For low contention case atleast on linux mutex (based on > futex) can be very fast. Criteria for choosing rwlock or mutex was > the intention of my post. > Interesting - what kind of mutex can a rwlock use, if mutex is based on futex? Non-futex mutex? What for? On my 2.6.3x, in no collision case there is not even a futex call; on collisions, futex calls (according to strace). Before futexes there was no other option. Edek