Oberon ||
Library ||
Module Index ||
Search Engine ||
Definition ||
Module
Ulm's Oberon Library:
SysCoroutines
NAME
SysCoroutines - system-dependent coroutine layout
SYNOPSIS
Implementation on the SPARCv8/Solaris architecture:
TYPE (* $O- $P- coroutine structure *)
Coroutine = POINTER TO CoroutineRec;
CoroutineRec = RECORD
interrupts: INTEGER;
started: INTEGER; (* 0, 1, or 2 *)
ucontext: ARRAY 448 OF BYTE;
END;
(* $O= $P= *)
Implementation on the I386/Linux architecture:
TYPE (* $O- $P- coroutine structure *)
Coroutine = POINTER TO CoroutineRec;
CoroutineRec = RECORD
interrupts: INTEGER;
started: INTEGER; (* 0, 1, or 2 *)
ucontext: ARRAY 24 OF BYTE;
END;
(* $O= $P= *)
DESCRIPTION
SysCoroutines
declares the system-dependent structures of coroutines. This is
intended for modules like SysStorage or SysInterrupts.
Following fields are included:
- interrupts
-
counts the number of asynchronous interrupts whose handler have
not been finished yet. This counter is maintained by SysInterrupts.
Coroutines with non-zero interrupt counters are considered as
non-tracable by the garbage collection.
- started
-
has a value of 0 for coroutines whose ucontext has not been
initialized yet, 1 for coroutines with a saved context but that were
never switched to, and 2 after the first activation of a coroutine.
- ucontext
-
contains the system-dependent context that is either maintained
by inline architecture (on the I386 architecture, for example) or
by system calls (on the SPARC architecture).
EXAMPLE
PROCEDURE Started(cr: Coroutines.Coroutine) : INTEGER;
VAR
scr: SysCoroutines.Coroutine;
BEGIN
scr := SYSTEM.VAL(SysCoroutines.Coroutine, cr);
RETURN scr.started
END Started;
SEE ALSO
- Coroutines
-
opaque type Coroutines.Coroutine
- SysInterrupts
-
maintenance of interrupt nest level of coroutines
Edited by: borchert, last change: 2005/08/25, revision: 1.1, converted to HTML: 2005/08/25
Oberon ||
Library ||
Module Index ||
Search Engine ||
Definition ||
Module