[gclist] Finalizers & Reference counting.

David Chase chase@world.std.com
Wed, 21 Aug 2002 19:06:10 -0400


At 01:26 PM 8/21/2002 -0400, Jerrold Leichter wrote:
>(Almost) all modern architectures provide cheap ways to increment or
>decrement and count atomically, and for the decrement case determine whether
>the result was 0.  The methods vary form interlocked increment/decrement
>operations that set condition codes based on the result to combining fetch-
>and-add operations to general load linked/store conditionals.

Is "modern architectures" code language for "not x86"?
LOCK-prefixed instructions there are not "cheap" in the
usual sense of the word, at least according to my understanding
and measurements (I generally care about locked CMPXCHG).
On a uniprocessor it is atomic if unlocked, but not on a
multiprocessor.

David Chase