next up previous 68
Next: Synchronisation
Up: ADAM The Control Subsystem
Previous: Messages from Subsidiary Tasks


Re-scheduling

An action being obeyed or cancelled can request that it is re-entered (re-scheduled) upon some future event by calling TASK_PUT_REQUEST() and optionally TASK_PUT_DELAY(). See SUN/134 for details.

Any values of the request and delay which have been set are returned to the calling routine (DTASK_OBEY or DTASK_CANCEL by DTASK_APPLIC and DTASK_ACT_SCHED is called to check if a reschedule is required and set it up if required.

Reschedule requests may be:

ACT__STAGE
Re-schedule immediately (in fact after 10ms).
ACT__WAIT
Re-schedule after DELAY ms.
ACT__ASTINT
Re-schedule on AST (with timeout of DELAYms).
ACT__MESSAGE
Re-schedule on completion of an action in a subsidiary task (with timeout of DELAYms).
For ACT__ASTINT and ACT__MESSAGE, DELAY may be MESSYS__INFINITE indicating that no timer should be set.

As each reschedule is set, the action sequence number, initially 0, is incremented.

Where a timeout is required, an ATIMER timer is set by:

CALL DTASK_RESCHED( ACTPTR, ACTCNT, SCHEDTIME, STATUS )

ACTPTR specifies the action to be rescheduled, and ACTCT the timer identifier. The timer is set to call DTASK_CHDLR() after SCHEDTIME millisecs. DTASK_CHDLR() is written in C and is a straight-through call to DTASK_ASTHDLR() which calls AMS_RESMSG() to send a reschedule message (message status MESSYS__RESCHED) to this task.

When DTASK_DTASK() receives the reschedule message, it calls DTASK_TIMEOUT() which de-constructs the passed value into an action pointer and count, and checks that the specified action reschedule was expected.

If that checks OK, the action is obeyed (DTASK_OBEY()); if not, it is ignored.



next up previous 68
Next: Synchronisation
Up: ADAM The Control Subsystem
Previous: Messages from Subsidiary Tasks

ADAM The Control Subsystem
Starlink System Note 77
A.J. Chipperfield
16 August 2001
E-mail:ussc@star.rl.ac.uk

Copyright © 2000 Council for the Central Laboratory of the Research Councils