comp.lang.ada
 help / color / mirror / Atom feed
From: mcsun!sunic!psinntp!psinntp!intrepid!gary@uunet.uu.net  (Gary Funck)
Subject: Re: Ada delay
Date: 19 Sep 92 17:56:45 GMT	[thread overview]
Message-ID: <1992Sep19.175645.10076@intrepid.com> (raw)

In article <Buq4Mr.D7H@math.uwaterloo.ca> amichail@plg.uwaterloo.ca (Amir Micha
il) writes:
>How is the Ada delay statement implemented?  I suppose it uses a hardware 
>timer coupled with a clock server, but this would mean that the time
>taken for a delay is unbounded (since we have to search an ordered list
>of tasks).  If this is true, then how can one possibly use it for
>realtime scheduling of periodic tasks??
>

Amir,

Your note brings up a few issues:

- "unbounded" may not be quite correct.  Searching a linear list and
making a task ready to run is linear with respect to the number of
tasks in the delay queue.

- Some implementations use either a timer that is periodic (interrupts
at fixed time intervals) or an "interval timer" that whose time
delta is reprogrammed to the delta of the next task waiting in
the delay queue.  The periodic timer generally has less skew, but
places a consistent and sometimes heavy load on the system, if the
time granularity is small.  Overheads to due to processinmg periodic timer
interrupts can be in the neighborhood of 10-15%, if the time period
is in the neighborhood of 1 KHz, for example.

- The Ada language specifies that a task delay must be *no less than*
than the requested time delay.  An implementation can meet the
letter of law, by processing delay requests, only at language
defined preemption points.  Most "modern" Ada runtimes support
task preemption at arbitrary ppints in the execution of a task;
some older ones only checked when an Ada program performed a
tasking operation, leading to tryly unbounded delays.

- In practice, applications that require tight time synchronization
attach an Ada interrupt entry to an interrupt tied to a periodic
timer, sometimes called the "frame generator".  If the context
switch from interrupt level to task level takes too long, some
applications do the bulk of the periodic processing at interrupt
level, defining an interrupt service routine.  The facilities for
handling events directly at interrupt level are vendor specific.
For example, Verdix has something called "passive interrupt tasks" that give
you the syntax of tasks, and most of the efficiency of interrupt
service routines.  

- Ada 9X includes something called the "real-time annex" to the language
definition that is directed at solving some of the known problems
with using Ada in a real-time environment.
-- 
| Gary Funck  		    gary@intrepid.com  [uunet!uupsi!intrepid!gary]
| Intrepid Technology Inc., Mountain View CA (415) 964-8135
--

             reply	other threads:[~1992-09-19 17:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-09-19 17:56 Gary Funck [this message]
  -- strict thread matches above, loose matches on Subject: below --
1992-09-21 13:43 Ada delay John Goodenough
1992-09-21  2:40 H.Shrikumar{shri@ncst.in}
1992-09-18  9:05 Guangxing Li
1992-09-18  1:11 mcsun!uknet!yorkohm!minster!ken
1992-09-17 17:45 Bob Kitzberger
1992-09-17 15:04 Jorge Luis Diaz-Herrera
1992-09-17 14:26 cis.ohio-state.edu!news.sei.cmu.edu!firth
replies disabled

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