User:Kr/A Thread's Life

From Apache OpenOffice Wiki
< User:Kr
Revision as of 09:46, 3 September 2007 by Kr (Talk | contribs)

Jump to: navigation, search

Status: draft


Two types of Threads

  • holder threads
  • holded threads

Holder Thread

  • Holder threads keep the process alife.
  • The last holder thread terminates the process.
  • Every holder thread must be detached, as no other thread is going to join it.

Examples

  • GUI dispatcher thread


Holded Thread

  • Holded threads don't keep the process alife.
  • Any holded thread needs to be joined (terminated / cancelled) when (indirectly) released by a holder thread.
  • Every holded thread must be joinable, as a holder thread is going to join it, latest during termination.

Examples

  • cache flushing threads


Notes

  • Threads may dynamically switch from one type to the other and vice versa.
  • The "main" thread is a holder thread.
Personal tools