From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.129.103.197 with SMTP id b188mr30145281ywc.3.1494305068775; Mon, 08 May 2017 21:44:28 -0700 (PDT) X-Received: by 10.157.34.229 with SMTP id y92mr1318548ota.15.1494305068736; Mon, 08 May 2017 21:44:28 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!feeder.erje.net!2.eu.feeder.erje.net!feeder.usenetexpress.com!feeder1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!t26no486807qtg.1!news-out.google.com!m134ni180itb.0!nntp.google.com!c26no1642810itd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 8 May 2017 21:44:28 -0700 (PDT) In-Reply-To: <7b1446ef-8e5f-4f3f-803d-b5a2f47bae0e@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:191:8303:2100:5985:2c17:9409:aa9c; posting-account=fdRd8woAAADTIlxCu9FgvDrUK4wPzvy3 NNTP-Posting-Host: 2601:191:8303:2100:5985:2c17:9409:aa9c References: <0fc56bf7-1cfa-4776-9c47-a573db315c5f@googlegroups.com> <7b0c08eb-be62-4d14-ae99-cad038ad0a62@googlegroups.com> <077e7f6a-5a7b-4b88-a16f-7672aec18a17@googlegroups.com> <8a968aae-79e4-421b-ba4b-e0a9a33ce0db@googlegroups.com> <7b1446ef-8e5f-4f3f-803d-b5a2f47bae0e@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <7cc1b7ca-67f8-4ef7-9608-d39cf6df80e5@googlegroups.com> Subject: Re: Portable memory barrier? From: Robert Eachus Injection-Date: Tue, 09 May 2017 04:44:28 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:46719 Date: 2017-05-08T21:44:28-07:00 List-Id: On Tuesday, May 9, 2017 at 12:32:38 AM UTC-4, Robert Eachus wrote: Did it again, well posted before I was finished editing. But this time I'm= just going to add a few sentences: When reading x86 rules, understand moves to registers as reads, moves to me= mory as writes even though they use the same op code. Oh, and notice that = the strict ordering on writes is on moves to cache, not on when they get co= pied back to main memory. Same goes for reads. Reads and writes of differe= nt locations can be reordered, reads cannot be moved past reads, writes can= not be moved past writes. The rule on reordering of reads has a big gotcha. The CPU can speculativel= y read from a memory location whenever it wants. But it must not DO anythi= ng with that data until a real read comes along. This allows the cache to = pull in a complete cache line among other things. And the most important p= art of not do anything is no interrupts.