Path: ...!Xl.tags.giganews.com!local-3.nntp.ord.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 17 Dec 2024 20:38:18 +0000 Sender: Andrew Haley From: aph@littlepinkcloud.invalid Subject: Re: Memory ordering Newsgroups: comp.arch References: <-rKdnTO4LdoWXKj6nZ2dnZfqnPWdnZ2d@supernews.com> <5yqdnU9eL_Y_GKv6nZ2dnZfqn_GdnZ2d@supernews.com> <2024Nov15.082512@mips.complang.tuwien.ac.at> <20241115152459.00004c86@yahoo.com> <2024Nov17.161752@mips.complang.tuwien.ac.at> <2024Dec3.100144@mips.complang.tuwien.ac.at> <3aa9f0a3d3dde86193abb1c01e52d03a@www.novabbs.org> User-Agent: tin/1.9.2-20070201 ("Dalaruan") (UNIX) (Linux/4.18.0-553.27.1.el8_10.x86_64 (x86_64)) Message-ID: Date: Tue, 17 Dec 2024 20:38:18 +0000 Lines: 19 X-Trace: sv3-gVr+vjYTDpfwywP+mvxPgWY4dIy4QKQgz9cgOFm9F49vNUEk5G5cnDxqGT9HO3KA8CL0GywRhE6yOre!dCF188uQgUFy0FdaroByO3zWWGd8wfvanvivXfYBz58TY6jmZ0ISL2bpM2DF0wV1swAPfMBn4XGJ!yTaxJHvj X-Complaints-To: www.supernews.com/docs/abuse.html X-DMCA-Complaints-To: www.supernews.com/docs/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 Bytes: 2548 jseigh wrote: > > C++ doesn't use #LoadStore, etc... memory ordering terminology. They > use acquire, release, cst, relaxed, ... While in some cases it's > straightforward as to what that means, in others it's less obvious. Indeed you don't know the exact mapping to instructions, but that's the idea: you ask for the ordering model you want, and the compiler chooses the instructions. > Non-obvious isn't exactly what you want when writing multi-threaded > code. There's enough subtlety as it is. There are efficiency advantages to be had from getting away from explicit barriers, though. AArch64 has seq-cst load and store instructions which don't need the sledgehammer of of a full StoreLoad between a store and a load. Andrew.