From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Wed, 28 Apr 2010 23:39:59 -0300 Message-ID: From: "Federico G. Benavento" To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: Re: [9fans] LOCK XADD for i386 incref/decref Topicbox-Message-UUID: 1212da22-ead6-11e9-9d60-3106f5b1d025 sorry, but why in the compiler and not as a library function like in libthread? http://plan9.bell-labs.com/sources/plan9/sys/src/libthread/xinc386.s On Wed, Apr 28, 2010 at 4:16 PM, Venkatesh Srinivas 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=82f13e6755218ecb7dec0f1392b2eb8bfe0bb2c7). > On a 2.66 GHz Core 2 Duo, we noticed a full 14% reduction in runtime > (9.6s vs 11.2s) of the thread-ring test. Similar performance gains > were noticed on a Core i7 machine, but I no longer have the numbers > handy. > > Perhaps this change is interesting for Plan 9... > > -- vs > > -- Federico G. Benavento