From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from vm593.rz.uni-osnabrueck.de (vm593.rz.uni-osnabrueck.de [IPv6:2001:638:508:100::83ad:11c7]) by sourceware.org (Postfix) with ESMTPS id 949D7385800D for ; Wed, 21 Jul 2021 13:00:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 949D7385800D 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 vm079.rz.uni-osnabrueck.de (vm079.rz.uni-osnabrueck.de [IPv6:2001:638:508:100::83ad:1027]) by vm593.rz.uni-osnabrueck.de (Postfix) with ESMTP id 074A9202ACE for ; Wed, 21 Jul 2021 15:00:01 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by vm079.rz.uni-osnabrueck.de (Postfix) with ESMTP id EEA0C20F449 for ; Wed, 21 Jul 2021 15:00:00 +0200 (CEST) From: "Amar Memic" To: gcc@gcc.gnu.org User-Agent: SOGoMail 5.1.1 MIME-Version: 1.0 Date: Wed, 21 Jul 2021 15:00:00 +0200 Subject: 6.55 Built-in Functions for Memory Model Aware Atomic Operations Message-ID: <6974-60f81a80-e4b-3b2ba4c0@223414201> X-Forward: 109.175.38.178 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: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 13:00:04 -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