From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from vm594.rz.uni-osnabrueck.de (vm594.rz.uni-osnabrueck.de [131.173.18.52]) by sourceware.org (Postfix) with ESMTPS id 68E0A3853800 for ; Wed, 21 Jul 2021 08:20:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 68E0A3853800 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=uni-osnabrueck.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=uni-osnabrueck.de Received: from vm075.rz.uni-osnabrueck.de (vm075.rz.uni-osnabrueck.de [131.173.16.35]) by vm594.rz.uni-osnabrueck.de (Postfix) with ESMTP id D236D200054 for ; Wed, 21 Jul 2021 10:20:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by vm075.rz.uni-osnabrueck.de (Postfix) with ESMTP id 9C2C520F43E for ; Wed, 21 Jul 2021 10:20:32 +0200 (CEST) From: "Amar Memic" To: libstdc++@gcc.gnu.org User-Agent: SOGoMail 5.1.1 MIME-Version: 1.0 Date: Wed, 21 Jul 2021 10:20:32 +0200 Subject: 6.55 Built-in Functions for Memory Model Aware Atomic Operations Message-ID: <49b2-60f7d900-cf7-23647ec0@27167096> X-Forward: 2001:638:508:fe00::1021 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, HTML_MESSAGE, HTML_OBFUSCATE_05_10, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 08:20:36 -0000 Hi,6.55 Built-in Functions for Memory Model Aware Atomic Operations (ht= tps://gcc.gnu.org/onlinedocs/gcc/=5F005f=5F005fatomic-Builtins.html)=C2= =A0 says:Note that the =E2=80=98=5F=5Fatomic=E2=80=99 builtins assume t= hat programs will conform to the C++11 memory model. In particular, the= y assume that programs are free of data races. See the C++11 standard f= or detailed requirements. I think the second sentence is a bit misleading because atomics should = handle data races. Especially, interleaving read/write or write/write operations should be= well-defined. If you assume that programs are free of data races, then you could not = implement spinlock based on these atomics, for example. I hope you can help me to interpret the paragraph in the right manner.=C2= =A0 Thanks in advance Amar Memic