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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1a4f1da89a53b5ea X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-11 06:02:08 PST Path: supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.bu.edu!inmet!not-for-mail From: Tucker Taft Newsgroups: comp.lang.ada Subject: Re: Pragma Atomic Date: Thu, 11 Jan 2001 09:00:12 -0500 Organization: AverStar (formerly Intermetrics) Burlington, MA USA Message-ID: <3A5DBC6C.1E665DA7@averstar.com> References: <93g48c$ehk$1@nnrp1.deja.com> <93i7oi$a6laq$2@ID-25716.news.dfncis.de> NNTP-Posting-Host: nebula.burl.averstar.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: inmet2.burl.averstar.com 979221612 13968 141.199.8.77 (11 Jan 2001 14:00:12 GMT) X-Complaints-To: usenet@inmet2.burl.averstar.com NNTP-Posting-Date: 11 Jan 2001 14:00:12 GMT X-Mailer: Mozilla 4.75 [en] (X11; U; SunOS 5.7 sun4u) X-Accept-Language: en Xref: supernews.google.com comp.lang.ada:3907 Date: 2001-01-11T14:00:12+00:00 List-Id: Nick Roberts wrote: > ... > > As for reads and writes being performed indivisibly, Reset is > > one bit, so how could a read or write of it be "divisible"? > > Reset is not necessarily one bit. It may be a size chosen by the compiler > (e.g. one word), or determined by a representation clause. > > Furthermore, if it is one bit in size, it may (indeed it is liekly to) cause > normal accesses to it to be divisible. To effect one read access, a typical > machine will need to: load the word containing the bit; mask off the rest of > the word; perhaps shift the bit along. If this takes several instructions, > those instructions will probably be interruptible. This is not really the problem. The thing which has to be "indivisible" is the interaction with memory, and in this case, the read from memory is generally just one uninterruptable instruction. The problem is more with "write" where it is supposed to involve exactly one memory access instruction, but in general, to write a bit field, you must first read the entire surrounding word, make the appropriate change, and then rewrite the entire surrounding word, which violates the volatility rules by incurring an extra "read", and if neighboring bits are also volatile, causes further violations of volatility. So the original questioner is in some sense right that a single bit marked atomic is not saying much more than marking the single bit volatile. > ...> > -- thanks, Adam > > I hope I've cleared some things up! > > -- > Nick Roberts -- -Tucker Taft stt@avercom.net http://www.averstar.com/~stt/ Chief Technology Officer, AverCom, Inc. (A Titan Company) Burlington, MA USA (AverCom was formed 1/1/01 from the Commercial Division of AverStar) (http://www.averstar.com/services/ebusiness_applications.html)