\"\" \"\" \"\"
Go backward to stop(): Stopping a Thread
Go up to Miscellaneous
RISC-Linz logo

root(): Root Set of Garbage Collection

t->root()
t->noroot()
      Thread<R> t
      Threadn<R, A1, ..., An> t

Specification: The first form declares thread t to be in the root set of the garbage collector. A thread in the root set will be not reclaimed by the garbage collector even if it is not referenced any more by the main thread. The second form removes t from the root set.

Constraints: It is illegal to apply root to some t which is already in the root set of the garbage collector and to apply noroot to some t which is not in the root set.

Note: At program start, only the main thread is in the root set. A thread which is not (directly or indirectly) referenced by the main thread and which is also not in the root set of the garbage collector may be terminated at any time and may be even not executed at all.


Author: Wolfgang Schreiner
Last Modification: April 12, 1997