User:Kr/A Thread's Life
From Apache OpenOffice Wiki
Status: draft
Contents
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.