From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Tue, 7 Sep 2010 15:48:09 -0400 To: me@endeavour.zapto.org, 9fans@9fans.net Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] LOCK XADD for i386 incref/decref Topicbox-Message-UUID: 520403f4-ead6-11e9-9d60-3106f5b1d025 On Wed Apr 28 15:18:01 EDT 2010, me@endeavour.zapto.org wrote: > Hi, > > A few months ago, I added a patch to inferno-npe to use LOCK XADD > instead of the current lock/add/unlock sequence for incref and decref: > (http://code.google.com/p/inferno-npe/source/detail?r=b83540e1e77e62a19cbd21d2eb54d43d338716a5 > and http://code.google.com/p/inferno-npe/source/detail?r=82f13e6755218ecb7dec0f1392b2eb8bfe0bb2 sorry for the really long lag. finally clearing out my my inbox. this patch is incorrect because incref() and decref() assume that they are reusing the same lock that protects the whole structure. this incref is equivalent to lock(structure) structure->ref++; unlock(structure) and not something like lock xadd. - erik