comp.lang.ada
 help / color / mirror / Atom feed
From: "Samuel T. Harris" <u61783@gsde.hso.link.com>
Subject: Re: ADA task
Date: 1996/09/13
Date: 1996-09-13T00:00:00+00:00	[thread overview]
Message-ID: <323A1FF2.2781@gsde.hso.link.com> (raw)
In-Reply-To: 51cjp0$q7k@watnews1.watson.ibm.com


Norman H. Cohen wrote:
> ...
          delay until Next_Wakeup;
> ...
> 
> The "delay until" statement is a new feature in Ada 95.  In Ada 83 you
> would write

Yes, this is a very nice addition to Ada 95, especially for us
simulation folks.

> 
>    delay Next_Wakeup - Calendar.Clock;
> 
> which delays for the specified amount of time (in this case, the time
> from now until Next_Wakeup).

Unfortunately, Ada 83 semantics specify only that the delay
will be at least as long as the delay. It can be more then
the delay (possible much more). It depends on the fidelity
of the runtime system, the desired frequency, and the load
caused by other tasks.

An alternative is to use passive tasks with wakeup entries
and tie a master task to a realtime clock interrupt.
The master task then rendevous with the passive tasks.
If all tasks are harmonic, then the least common multiple
frequency is used and a simple clock pulse will suffice.
If all tasks are not harmonic, then a programmable "alarm"
is required based on an interval sequence determined
by the least common multiple of all harmonic groups.
When a "hit" occurs, the master task wakes all passive
tasks on that frequency(ies) and uses the interval table
to adjust the alarm for the next "hit". Of course, this
all assumes only one alarm is available.

If more than one alarm is available, then each harmonic
group gets its own alarm and its own master task. Each
alarm is programmed and used as a simple pulse and we
are back to multiple instance of the first technique
above.

> 
> --
> Norman H. Cohen    ncohen@watson.ibm.com

-- 
Samuel T. Harris, Senior Engineer
Hughes Training, Inc. - Houston Operations
2224 Bay Area Blvd. Houston, TX 77058-2099
"If you can make it, We can fake it!"




  reply	other threads:[~1996-09-13  0:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-09-11  0:00 ADA task Roumen Roupski
1996-09-12  0:00 ` Philip Brashear
1996-09-13  0:00 ` Norman H. Cohen
1996-09-13  0:00   ` Samuel T. Harris [this message]
1996-09-14  0:00     ` Robert Dewar
1996-09-14  0:00       ` Samuel T. Harris
1996-09-15  0:00         ` David C. Hoos, Sr.
1996-09-16  0:00           ` Samuel T. Harris
1996-09-16  0:00     ` Norman H. Cohen
1996-09-14  0:00   ` Roumen Roupski
1996-09-16  0:00     ` Norman H. Cohen
1996-09-14  0:00   ` Ken Garlington
1996-09-16  0:00   ` Robert I. Eachus
  -- strict thread matches above, loose matches on Subject: below --
1996-09-17  0:00 Marin David Condic, 407.796.8997, M/S 731-93
1996-09-19  0:00 ` Norman H. Cohen
1996-09-20  0:00   ` Robert A Duff
1996-09-17  0:00 Marin David Condic, 407.796.8997, M/S 731-93
1996-09-20  0:00 ` Robert A Duff
1996-09-18  0:00 tmoran
replies disabled

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