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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c6acbb9f2027b8c9 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!newsfeed.stueberl.de!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: volatile vs aliased Date: Sat, 08 Oct 2005 07:10:57 +0100 Organization: Pushface Message-ID: References: <1128525722.605730.281980@g43g2000cwa.googlegroups.com> <87mzlnomca.fsf@ludovic-brenta.org> <1421562.dbAHjS9XJS@linux1.krischik.com> <1128598604.142021.239190@g44g2000cwa.googlegroups.com> <21305827.4TOYkjRP7N@linux1.krischik.com> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1128751852 1684 62.49.19.209 (8 Oct 2005 06:10:52 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sat, 8 Oct 2005 06:10:52 +0000 (UTC) Cancel-Lock: sha1:CdyXzruFo1fm5LWszeEpoLUpFUI= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Xref: g2news1.google.com comp.lang.ada:5506 Date: 2005-10-08T07:10:57+01:00 List-Id: Martin Krischik writes: > Well, all machine code I have seen so far only have a INC for > registers. And if you think for it for a sec.: It can't be another > way, even if there is a INC for memory the CPU still has to read the > memory increment internally write back. On the other hand, there is a test-and-set instruction in many architectures, isn't there? If the memory entity (byte?) is clear, set it and succeed; if not, fail. This would presumably have to be done using an uninterruptible read-modify-write cycle. So it might be _possible_. But whether modern architectures actually do it is another matter. We recently had a problem where the BSP for our target board was upgraded to make VME slave (exported) memory cachable by default. This required so much in the way of bus snooping etc that if you accessed the shared memory too often the card would freeze -- not good.