Oberon || Library || Module Index || Search Engine || Definition || Module


Ulm's Oberon Library:
PrioritySchedulers


NAME

PrioritySchedulers - scheduler with priorities

SYNOPSIS

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);

DESCRIPTION

PrioritySchedulers provides a scheduler on base of Schedulers that supports priorities.

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.

DIAGNOSTICS

PrioritySchedulers does not generate any error events.

SEE ALSO

PriorityJobs
variant of Jobs that is based upon PrioritySchedulers
RoundRobin
simple round robin scheduler without priorities
Schedulers
framework for simple schedulers

Edited by: borchert, last change: 2001/05/21, revision: 1.1, converted to HTML: 2001/05/21

Oberon || Library || Module Index || Search Engine || Definition || Module