Subject: Re: Atomic ops API
To: Brian Ginsbach <ginsbach@NetBSD.org>
From: Jason Thorpe <thorpej@shagadelic.org>
List: tech-kern
Date: 03/13/2007 09:33:19
On Mar 13, 2007, at 8:53 AM, Brian Ginsbach wrote:
> /*
> * Exchange values in memory. test_and_set is unconditional.
> * compare_and_swap is conditional, returning 1 and swapping if the
> * memory value equals "old".
Yah, that's basically what I'm doing. I just don't want to be forced
to return the old value if the swap does not occur, nor do I
particularly want to return the old value at all (partially because it
means more instructions in the inner-loop of most load-locked/store-
conditional type systems).
-- thorpej