9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: me@endeavour.zapto.org, 9fans@9fans.net
Subject: Re: [9fans] LOCK XADD for i386 incref/decref
Date: Tue,  7 Sep 2010 15:48:09 -0400	[thread overview]
Message-ID: <d5de2ba3c89c5cfd415225edbd788514@ladd.quanstro.net> (raw)
In-Reply-To: <u2vf75780241004281216q98cedf0bpa528b406a4f833ff@mail.gmail.com>

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



      parent reply	other threads:[~2010-09-07 19:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <r2zf75780241004281003ua9c23045xc4831f3735477989@mail.gmail.com>
2010-04-28 19:16 ` Venkatesh Srinivas
2010-04-29  2:39   ` Federico G. Benavento
2010-04-29  2:46     ` Federico G. Benavento
2010-09-07 19:48   ` erik quanstrom [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d5de2ba3c89c5cfd415225edbd788514@ladd.quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    --cc=me@endeavour.zapto.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).