comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Uninterruptible (atomic) operation?
Date: 1996/12/12
Date: 1996-12-12T00:00:00+00:00	[thread overview]
Message-ID: <dewar.850399886@merv> (raw)
In-Reply-To: 9612111939.AA14087@most


Wes asks

"This is pretty close.  But why do we need the lock?  Isn't that implied
by Atomic/Shared?  LRM 83 9.11 (11) "each of direct reading and direct
updating is implemented as an individual implementation.""


Look at the code more carefully. The writer is depending on being able
to do a series of operations on the value without any other writers getting
in the way.

The only thing that a reader needs is a guarantee of a consistent value.

pragma Atomic or Shared should NOT use an implementation that involves
a lock, implicit locks of this type are not at all in the spirit of what
is intended. If you need a lock, you must use task syncrhonization
primitives. the pragma is intended to identify cases where the hardware
does an atomic load or store with no additional overhead.

So, if the pragma is accepted, this approach does EXACTLY what you want.
If the pragma is rejected, then there is no cheap way of doing what you
want, particularly if you take the priority model of annex D seriously.





  parent reply	other threads:[~1996-12-12  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-12-11  0:00 Uninterruptible (atomic) operation? W. Wesley Groleau (Wes)
1996-12-09  0:00 ` John McCabe
1996-12-13  0:00   ` Robert Dewar
1996-12-12  0:00 ` Robert Dewar [this message]
1996-12-13  0:00 ` J-P. Rosen
1996-12-13  0:00 ` Robert I. Eachus
  -- strict thread matches above, loose matches on Subject: below --
1996-12-09  0:00 W. Wesley Groleau (Wes)
1996-12-09  0:00 ` Robert A Duff
1996-12-10  0:00   ` Bob Gilbert
1996-12-11  0:00   ` Robert I. Eachus
1996-12-11  0:00     ` Robert S. White
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox