Article View: comp.sys.acorn.tech
Article #443'volatile' in Norcroft/Acorn C
From: Clive Jones
Date: Tue, 29 Sep 1992 16:03
Date: Tue, 29 Sep 1992 16:03
22 lines
1532 bytes
1532 bytes
Hmm. I've just got my hands on a draft ANSI C standard, and it's quite clear, unfortunately, that an implementation is under no obligation at all to do this, however: It would be very nice if the compound assignment operators (+=, -=, *=, etc.) were atomic if applied to volatile variables. The obvious way to achieve this would be using SWP, with an Arm3Emulator module for processors before the Arm3 (the Arm250 DOES have the SWP instruction, doesn't it?). I assume the Arm3Support module doesn't catch attempts to use SWP/Co-processor 15 on older machines anyway? Is there any prospect of such code being included in future releases of Acorn/Norcroft C? Any news? Any comments on the suggestion? For the time being, I'll have to make an atomic_assign macro, using some sort of low-level swap function - not exactly efficient. As people may have guessed from this and a previous posting, I'm trying to get some proper concurrency going in C programs on the Archimedes. The results may be public domain soon. --Clive.
Technical Details
Message-ID:
<1992Sep29.160306.6352@infodev.cam.ac.uk>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!pavo.csi.cam.ac.uk!newsShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!pavo.csi.cam.ac.uk!news From: crj10@phx.cam.ac.uk (Clive Jones) Newsgroups: comp.sys.acorn.tech Subject: 'volatile' in Norcroft/Acorn C Message-ID: <1992Sep29.160306.6352@infodev.cam.ac.uk> Date: 29 Sep 92 16:03:06 GMT Sender: news@infodev.cam.ac.uk (USENET news) Organization: 6am Digital Playground Lines: 22 Telephone-Messages: +44 223 33 4900 Address: Christ's College, Cambridge CB2 3BU, ENGLAND. Nntp-Posting-Host: haddon.cl.cam.ac.uk