Subject: Re: Atomic ops API
To: Jason Thorpe <thorpej@shagadelic.org>
From: SODA Noriyuki <soda@sra.co.jp>
List: tech-kern
Date: 03/13/2007 15:55:49
>>>>> On Mon, 12 Mar 2007 23:28:47 -0700,
Jason Thorpe <thorpej@shagadelic.org> said:
> There is one major difference, however. Solaris defines "cas" as
> COMPARE-AND-SWAP, returning the previous value of the memory cell.
> I have defined it as COMPARE-AND- STORE, returning true if the ops
> succeeds, or false otherwise. The reason for this is because some
> platforms will have extreme difficulty implementing
> COMPARE-AND-SWAP, whereas COMPARE-AND-STORE is somewhat easier for
> these platforms.
In that case, the functions should use a different name instead of
*_cas_*(), shouldn't they?
e.g.
*_csi_* (compare and store interlocked)?
*_cs_* (compare and store)?
--
soda