On Tue, 20 Jan 2009 04:19:26 -0000, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote:

"Brendan Miller" <catph...@catphive.net> writes:
Maybe I'm missing something here but a lock free algorithm for
reference counting seems pretty trivial. As long as you can atomically
increment and decrement an integer without locking you are pretty much
done.

What cpu's do you know of that can atomically increment and decrement
integers without locking?

x86 (and pretty much any 8080 derivative, come to think of it).

That said, what you actually need is an atomic read-and-increment,
which is a lot harder to find.  Even if you could find a platform
supporting it, it doesn't help you on other platforms you may need to
run on.  Just do the locking properly and worry about optimisations
later.

--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to