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


Ulm's Oberon Library:
Jobs


NAME

Jobs - initiation of background tasks

SYNOPSIS

TYPE Job = POINTER TO JobRec;
TYPE JobRec = RECORD (Disciplines.ObjectRec) END;
TYPE Procedure = PROCEDURE (job: Job);


PROCEDURE Submit(job: Job; proc: Procedure); PROCEDURE CreateCondition(VAR condition: Conditions.Condition; job: Job);

DESCRIPTION

Jobs allows to submit jobs which are running in the background, i.e. they do not block the calling task. Jobs is more efficient in the use of memory operations than usual background initiations because it maintaines a pool of unused tasks. That means that not each call of Submit causes a task to be newly created.

Submit passes proc to a separate task for invocation of proc with the given job (which may be an arbitrary extension of Job) as parameter. The job but not necessarily the associated task terminate when proc returns. Note that the job parameter must be newly created for each call of Submit and proc must not call directly or indirectly Tasks.Terminate.

CreateCondition returns a condition which evaluates to TRUE when job is finished. CreateCondition is free to return NIL if job is already finished.

DIAGNOSTICS

Jobs does not generate any error events on its own.

SEE ALSO

Tasks
general task management

BUGS

Jobs belongs to the set of modules which may delay program termination because they maintain a set of tasks (like, for example, RemoteObjects). The task pool is released if a garbage collection starts (Process.startOfGarbageCollection) or on program termination (Process.termination), though.
Edited by: borchert, last change: 1995/12/30, revision: 1.1, converted to HTML: 1997/04/28

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