Subject: Re: Atomic ops API
To: Brian Ginsbach <ginsbach@NetBSD.org>
From: SODA Noriyuki <soda@sra.co.jp>
List: tech-kern
Date: 03/14/2007 22:13:25
>>>>> On Tue, 13 Mar 2007 15:53:19 +0000,
Brian Ginsbach <ginsbach@NetBSD.org> said:
>> 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)?
> Not necessarily; I think that the IRIX atomic op API implements
> COMPARE-AND-SWAP as Jason describes COMPARE-AND-STORE.
Well, what I'm worrying about here is not what people think about
the name CSI, but software portability issue.
For example, what happens one wants to port ZFS from Solaris to
NetBSD?
Because the *_csi_*() functions have same names but different
semantics, we have to have #if defined(__NetBSD__) or something
like that to port it, isn't it?
If the functions have different names, what we need is wrapper
functions, and such #ifdef isn't needed.
(Well, of course this isn't exactly true, because there are
lots of differences between Solaris and NetBSD. But my point is
that using same name increases the difficulty of the porting.
Using different name decrease the difficulty.)
P.S.
I've heard at AsiaBSDCon that ZFS will be integrated to FreeBSD really
soon. That means NetBSD port is also possible.
--
soda