Oberon || Library || Module Index || Search Engine || Definition || Module
TYPE TaskGroup = POINTER TO TaskGroupRec; TYPE TaskGroupRec = RECORD (Schedulers.TaskGroupRec) END; TYPE Task = POINTER TO TaskRec; TYPE TaskRec = RECORD (Schedulers.TaskRec) END; TYPE Priority = INTEGER;
PROCEDURE CreateTaskGroup(VAR tg: Tasks.TaskGroup);
PROCEDURE SetPriority(task: Task; priority: Priority); PROCEDURE GetPriority(task: Task; VAR priority: Priority);
Each scheduler created by CreateTaskGroup maintains an internal integer-valued clock that starts from 0 and is incremented by 1 on each dispatch. The internal priority of a task maintained by PrioritySchedulers is defined to be the sum of its external priority (set by SetPriority, is 0 by default) and the difference between the current time and the time the task was executed last.
The scheduler dispatches always the task that is ready for execution and has the top-most internal priority. In case of a tie, the higher external priority wins.
If all tasks belonging to a task group share the same priority, the scheduler behaves identical to RoundRobin.
CreateTaskGroup creates a task group that is governed by Schedulers and PrioritySchedulers.
SetPriority allows to change the priority of task. The current priority of a task maintained by PrioritySchedulers may be retrieved using GetPriority.
Oberon || Library || Module Index || Search Engine || Definition || Module