This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/2] Optimize generic spinlock code and use C11 like atomic macros.
- From: Andreas Schwab <schwab at suse dot de>
- To: Stefan Liebler <stli at linux dot vnet dot ibm dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 10 Apr 2017 15:36:37 +0200
- Subject: Re: [PATCH 1/2] Optimize generic spinlock code and use C11 like atomic macros.
- Authentication-results: sourceware.org; auth=none
- References: <1481905917-15654-1-git-send-email-stli@linux.vnet.ibm.com> <5857CF10.1060100@arm.com> <628f6311-239c-5eea-572c-c2acae6fcbee@linux.vnet.ibm.com> <1487017743.16322.80.camel@redhat.com> <60a34645-17e4-6693-1343-03c55b0c47ad@linux.vnet.ibm.com> <1487437038.20203.68.camel@redhat.com> <25ad863b-6f20-bfb7-95e6-3b04a2b3eee8@linux.vnet.ibm.com> <1487598702.20203.138.camel@redhat.com> <b57d3477-a041-7b06-82ac-6d2b6c6bb08c@linux.vnet.ibm.com> <1491487245.5374.161.camel@redhat.com> <09ae8ea7-4119-76c1-cd58-36cbdf587390@linux.vnet.ibm.com> <mvmmvbod6cj.fsf@suse.de> <97d9d43a-0bf1-7e93-6985-97d603c96844@linux.vnet.ibm.com>
On Apr 10 2017, Stefan Liebler <stli@linux.vnet.ibm.com> wrote:
> On 04/10/2017 10:17 AM, Andreas Schwab wrote:
>> On Apr 07 2017, Stefan Liebler <stli@linux.vnet.ibm.com> wrote:
>>
>>> /* ATOMIC_EXCHANGE_USES_CAS is equal to 1 if atomic_exchange operations
>>
>> Why 1 exactly, and not just non-zero?
>>
>> Andreas.
>>
>
> This points out that there is only a true/false choice and
> all architectures have to define it.
That doesn't answer my question. Why do you need the dance of checking
for 1 explicitly?
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."