Deutsch   English   Français   Italiano  
<vhlmkb$9big$3@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Newsgroups: comp.arch
Subject: Re: Memory ordering
Date: Wed, 20 Nov 2024 14:08:11 -0800
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <vhlmkb$9big$3@dont-email.me>
References: <vfono1$14l9r$1@dont-email.me> <vgm4vj$3d2as$1@dont-email.me>
 <vgm5cb$3d2as$3@dont-email.me> <YfxXO.384093$EEm7.56154@fx16.iad>
 <vh4530$2mar5$1@dont-email.me>
 <-rKdnTO4LdoWXKj6nZ2dnZfqnPWdnZ2d@supernews.com>
 <vh5t5b$312cl$2@dont-email.me>
 <5yqdnU9eL_Y_GKv6nZ2dnZfqn_GdnZ2d@supernews.com>
 <2024Nov15.082512@mips.complang.tuwien.ac.at> <vh7ak1$3cm56$1@dont-email.me>
 <20241115152459.00004c86@yahoo.com> <vh8bn7$3j6ql$1@dont-email.me>
 <vhb2dc$73fe$1@dont-email.me> <vhct2q$lk1b$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 20 Nov 2024 23:08:11 +0100 (CET)
Injection-Info: dont-email.me; posting-host="1af2c5fdc1883f7a8d3efca85f6fde60";
	logging-data="306768"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/XtZGuRZC1/aiv9Vy8ezrT+qAWI3yPqck="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:LXbuV6G87/pOSM/VKL2eWJEaJwI=
Content-Language: en-US
In-Reply-To: <vhct2q$lk1b$2@dont-email.me>
Bytes: 2556

On 11/17/2024 6:03 AM, jseigh wrote:
> On 11/16/24 16:21, Chris M. Thomasson wrote:
> 
>> Fwiw, in C++ std::memory_order_consume is useful for traversing a node 
>> based stack of something in RCU. In most systems it only acts like a 
>> compiler barrier. On the Alpha, it must emit a membar instruction. 
>> Iirc, mb for alpha? Cannot remember that one right now.
> 
> That got deprecated.  Too hard for compilers to deal with.  It's now
> same as memory_order_acquire.

Horrible! So on the SPARC in RMO mode if I used 
std::memory_order_consume to traverse a linked data structure in RCU it 
would use a god damn #LoadStore | #LoadLoad for every node load? If so, 
YIKES! Might as well use a single acquire after load the head of the list.



> 
> Which brings up an interesting point.  Even if the hardware memory
> memory model is strongly ordered, compilers can reorder stuff,
> so you still have to program as if a weak memory model was in
> effect.   Or maybe disable reordering or optimization altogether
> for those target architectures.
> 
> Joe Seigh
>