From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 21 Sep 92 13:43:28 GMT From: cis.ohio-state.edu!news.sei.cmu.edu!jbg@uunet.uu.net (John Goodenough) Subject: Re: Ada delay Message-ID: <1992Sep21.134328.27816@sei.cmu.edu> List-Id: In article <1992Sep19.175645.10076@intrepid.com>, gary@intrepid.com (Gary Funck ) writes: |> - 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. The "letter of the law" reads slightly differently these days. AI-00032, approved in March 1987, says: If an implementation supports more than one priority level, or interrupts, then it must also support a preemptive scheduling policy. In particular, the AI goes on to make clear that if a task is executing when a task with a higher priority becomes executable because a delay has expired, execution of the lower priority task must cease immediately so execution of the higher priority task can continue. The AI references 9.8(4) and says: Expiration of a delay means a task is eligible for execution. If an implementation determines that a delay has expired for a high priority task, then that task must be scheduled for execution. If the physical processor and other processing resources needed to execute the higher priority task are currently being used by a task of lower priority, execution of the lower priority task must be suspended. If preemptive scheduling is not feasible in a particular implementation, then the implementation should not provide multiple priority levels (see AI-00045) or support interrupts. (Note: the phrase "could sensibly be executed" [in 9.8(4)] refers to situations in which the high priority task can actually make use of the processor and other resources being used by the lower priority task. In some distributed processing situations, a high priority task may not be able to execute on some processors. Preemption is only required for processing resources the high priority task can use.) John B. Goodenough Goodenough@sei.cmu.edu Software Engineering Institute 412-268-6391