This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: testandset on powerpc
- To: Geoff Keating <geoffk at cygnus dot com>
- Subject: Re: testandset on powerpc
- From: Andreas Jaeger <aj at suse dot de>
- Date: 18 Jul 2000 18:02:09 +0200
- Cc: libc-alpha at sourceware dot cygnus dot com
- References: <ho66q3vbfb.fsf@maclaurin.suse.de><200007181528.IAA12286@localhost.cygnus.com><hok8ejtpgy.fsf@maclaurin.suse.de><200007181552.IAA12307@localhost.cygnus.com>
>>>>> Geoff Keating writes:
>> Cc: libc-hacker@sourceware.cygnus.com
>> From: Andreas Jaeger <aj@suse.de>
>> Date: 18 Jul 2000 17:42:05 +0200
Geoff> It'd be better if the generic code could be written to simply use
Geoff> compare_and_swap if it is available. That would make porting easier.
>>
>> Why? All platforms - except ppc - have testandset. IMHO porting
>> would be easier if ppc had testandset ;-).
Geoff> I don't understand. testandset is a specialisation of
Geoff> compare_and_swap. Every platform which can do compare_and_swap can do
Geoff> testandset. It's just that the generic code doesn't know this.
Geoff> It shouldn't be necessary for each porter to have to work out how to
Geoff> make compare_and_swap do testandset. It should just happen.
Since testandset is a specialisation it can be optimized - and that
seems to be the reason why testandset is used here instead of
compare_and_swap.
So what's the right thing to do?
- Add some define like HAS_TESTANDSET and implement testandset with
compare_and_swap if testandset is not available?
- Remove testandset completly?
Andreas
P.S. Geoff, your messages don't go to libc-hacker. It seems that
sourceware still doesn't like your setup. I've changed from
libc-hacker to libc-alpha to give other the chance to see your reply.
>> testandset is only used in spinlock.c. Should we document somewhere
>> that and why testandset is deprecated?
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.rhein-neckar.de