comp.lang.ada
 help / color / mirror / Atom feed
From: WhiteR@CRPL.Cedar-Rapids.lib.IA.US (Robert S. White)
Subject: Re: Uninterruptible (atomic) operation?
Date: 1996/12/11
Date: 1996-12-11T00:00:00+00:00	[thread overview]
Message-ID: <58lb74$e6e@flood.weeg.uiowa.edu> (raw)
In-Reply-To: EACHUS.96Dec10204319@spectre.mitre.org


In article <EACHUS.96Dec10204319@spectre.mitre.org>, eachus@spectre.mitre.org 

...snip...  using Ada95

>    The trick is to have a lock which
>all the potential modifiers respect, and to use pragma Atomic, and
>Atomic reads and writes, so that the readers can trust the value they
>see.
>
>    (Potential) Writer:
>
>       Acquire(lock);
>       Temp := Atomic_Object;
>       -- operations on Temp...
>       Atomic_Object := Temp;
>       Release(lock);
>
>    Reader:
>
>       Temp := Atomic_Object;
>       -- use value in temp.

  OK. I can live with that.  In the past using Ada83 and a local (company 
generated - DO-178BB) Real Time Executive (RTE) I could do the following 
(assuming a record structure):

  (Potential) Writer:
  with ESR;
    ...
  ESR.Enter_Critical_Section;
  -- various updating operations on Object.
  ESR.Leave_Critical_Section;

  
  Reader:
  
  with ESR;
    ...
  ESR.Enter_Critical_Section;
  Temp := Object.all;
  ESR.Leave_Critical_Section;
  -- use value in temp.

  With the real time constraint that thou use'st a minimum (1/3 of a tick max) 
time within a critical section.  ESR = Executive Service Routine package.

  But what Robert Eachus suggests is semantically equivalent and inclusive in a 
new ISO standardized language rather than a older language and a unique RTE.

_______________________________________________________________________
Robert S. White                    -- an embedded sys software engineer
WhiteR@CRPL.Cedar-Rapids.lib.IA.US --long/cheap alternate I-net address





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

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-12-09  0:00 Uninterruptible (atomic) operation? 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 [this message]
  -- strict thread matches above, loose matches on Subject: below --
1996-12-11  0:00 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
1996-12-13  0:00 ` Robert I. Eachus
1996-12-13  0:00 ` J-P. Rosen
replies disabled

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