Re: Strange asm generated by GCC...

Liste des GroupesRevenir à c arch 
Sujet : Re: Strange asm generated by GCC...
De : chris.m.thomasson.1 (at) *nospam* gmail.com (Chris M. Thomasson)
Groupes : comp.arch
Date : 23. Dec 2024, 22:20:33
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vkck71$1cp7c$1@dont-email.me>
References : 1 2 3 4 5 6
User-Agent : Mozilla Thunderbird
On 12/23/2024 12:35 AM, aph@littlepinkcloud.invalid wrote:
Chris M. Thomasson <chris.m.thomasson.1@gmail.com> wrote:
On 12/22/2024 7:49 PM, Chris M. Thomasson wrote:
On 12/21/2024 2:37 AM, aph@littlepinkcloud.invalid wrote:
jseigh <jseigh_es00@xemaps.com> wrote:
 
I don't see anything that forces a store memory barrier
on all the fail paths.  I could be missing something.
>
Why would there be one? If the store does not take place, there's no
need for a memory barrier because there's no store for anyone to
synchronize with. The only effect of a failed weak CAS is a load. If
you really need a store on failure because of its side effect you can
always add one.
>
Iirc, the membars for the success and failure can be "useful" for
popping from a lock-free stack. Wrt the C++ API the CAS can give you the
updated value on a failure. So, there is a load. Depending on what you
are doing, it might require an acquire.
>
Loading the head of the lock-free stack would be an acquire at the start
of the CAS loop. The CAS can use relaxed for the success and an acquire
for the failure.
 The para I'm quoting:
 
I don't see anything that forces a store memory barrier
 We were talking about the *store barrier* associated with the store.
There is acquire ordering, regardless of the success or failure of the
store.
Wrt a traditional lock-free stack, I think the store can use relaxed for the success path of a CAS.

Date Sujet#  Auteur
20 Dec 24 * Strange asm generated by GCC...21Chris M. Thomasson
20 Dec 24 +- Re: Strange asm generated by GCC...1Chris M. Thomasson
20 Dec 24 +* Re: Strange asm generated by GCC...5Chris M. Thomasson
20 Dec 24 i`* Re: Strange asm generated by GCC...4jseigh
20 Dec 24 i `* Re: Strange asm generated by GCC...3Chris M. Thomasson
20 Dec 24 i  +- Re: Strange asm generated by GCC...1Chris M. Thomasson
20 Dec 24 i  `- Re: Strange asm generated by GCC...1Chris M. Thomasson
20 Dec 24 `* Re: Strange asm generated by GCC...14jseigh
20 Dec 24  +* Re: Strange asm generated by GCC...2jseigh
20 Dec 24  i`- Re: Strange asm generated by GCC...1jseigh
21 Dec 24  `* Re: Strange asm generated by GCC...11aph
23 Dec 24   +- Re: Strange asm generated by GCC...1Chris M. Thomasson
23 Dec 24   `* Re: Strange asm generated by GCC...9Chris M. Thomasson
23 Dec 24    `* Re: Strange asm generated by GCC...8Chris M. Thomasson
23 Dec 24     +- Re: Strange asm generated by GCC...1Chris M. Thomasson
23 Dec 24     `* Re: Strange asm generated by GCC...6aph
23 Dec 24      `* Re: Strange asm generated by GCC...5Chris M. Thomasson
24 Dec 24       `* Re: Strange asm generated by GCC...4jseigh
24 Dec 24        `* Re: Strange asm generated by GCC...3Chris M. Thomasson
24 Dec 24         `* Re: Strange asm generated by GCC...2Chris M. Thomasson
24 Dec 24          `- Re: Strange asm generated by GCC...1jseigh

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal