\"\" \"\" \"\"
Go up to Miscellaneous
Go forward to root(): Root Set of Garbage Collection
RISC-Linz logo

stop(): Stopping a Thread

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

Specification: Hints to the system that the result of the thread to which t is bound is not needed any more.

Constraints: It is illegal to call this procedure, if t is not bound to any thread. Any further application Wait(s) is illegal if s is bound to the same thread as t.

Complexity: O(1).

Note: Since unreferenced threads are automatically reclaimed during garbage collection, it is not necessary to explicitly stop a thread. The only purpose of this facility is to guarantee that an unused and not yet activated thread is not activated before the next garbage collection takes place.

Implementation: If the thread is not yet activated, it is removed from the lazy thread stack. If the thread has been already activated, it will not be put back into the ready queue after the next preemption. If any other thread waits for the result of such a thread, it will be blocked forever (deadlock).


Author: Wolfgang Schreiner
Last Modification: April 12, 1997