On Wed Apr 28 15:18:01 EDT 2010, [email protected] 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