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

Ulm's Oberon Library:


Coroutines - interface to coroutine primitives


TYPE CoroutineTag = POINTER TO CoroutineTagRec;
TYPE CoroutineTagRec = RECORD END;

VAR defaultsize: LONGINT; VAR tag: CoroutineTag; VAR main: Coroutine; VAR source: Coroutine; VAR current: Coroutine;


Coroutines exports some variables which are used and set by the runtime system. All variables with the exception of defaultsize are read-only.

defaultsize defines the default stack size of a coroutine. The size of the activation record of the procedure calling SYSTEM.CRSPAWN is added to defaultsize. The default is taken if the second parameter of SYSTEM.CRSPAWN is omitted.

main is allocated during module initialization and points to the main coroutine.

The SYSTEM.CRSWITCH operation sets source to the calling coroutine.

current points to the coroutine currently active.

The pointer tag points to a tag record which is used by all coroutines. This allows coroutines to be identified by the garbage collector.

Edited by: borchert, last change: 1993/01/29, revision: 1.2, converted to HTML: 1997/04/28

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