Effect of priorities during activation 86-07-23 AI-00288/06 1 | !standard 09.08 (04) 86-07-23 AI-00288/06 | !class non-binding interpretation 85-11-22 | !status approved by WG9/AJPO 86-07-22 | !status approved by Director, AJPO 86-07-22 | !status approved by WG9/Ada Board 86-07-22 | !status approved by Ada Board 86-07-22 !status approved by WG9 86-05-09 !status committee-approved (9-1-2) 86-02-20 !status committee-approved (8-1-0) 85-11-22 (pending letter ballot) !status work-item 85-04-10 !status received 84-10-01 !references 83-00424 !topic Effect of priorities during activation !summary 85-12-27 A task activation should be performed with the priority of the task being activated or the priority of the task causing the activation, whichever is higher. !question 86-01-20 Suppose a high priority task activates a low priority task at a time when a task of intermediate priority is eligible for execution. The high priority task cannot execute until the low priority task is activated, but the low priority task cannot be executed (and thereby activated) until the intermediate priority task is no longer eligible for execution. In short, since task activation is performed at the priority of the task being activated, execution of the activating task may be delayed until the task being activated has the highest priority of those eligible to run. This behavior seems inconsistent with the behavior during a rendezvous, since a rendezvous executed on behalf of a high priority task is executed at the priority of that task or higher. Was it intended that activations be performed at the priority of the task causing the activation, if this task's priority is higher? !recommendation 85-12-16 When a task causes the activation of another task, if the priorities of both tasks are defined, the activation is executed with the higher of the two priorities. If only one of the two priorities is defined, the activation is executed with at least that priority. If neither is defined, the priority of the activation is undefined. !discussion 85-12-27 Task activation is similar to rendezvous in that one task waits until another completes a requested action. In the case of a rendezvous, the calling task must wait until the rendezvous is complete (i.e., until execution of the accept statement is complete). In the case of activation, the task causing the activation must wait until the task being activated has elaborated its Effect of priorities during activation 86-07-23 AI-00288/06 2 declarative part. In both cases, it is undesirable for the execution of high priority tasks to be unnecessarily delayed. This goal is accomplished for rendezvous by rules (9.8(5)) saying that a rendezvous is executed with the priority of the calling or called task, whichever is higher. A similar rule should have been given for task activation -- when a task causes the activation of other tasks, the activation should be performed with either the priority of the task causing the activation or the priority of the task being activated, whichever is higher.