Multithreading Models
User and Kernel Threads

Kernel threads - threads supported by the Kernel (mac os, windows)
User threads - management done by user-level threads library
libraries include:
- POSIX Pthreads
- Windows threads
- Java threads

Many-to-One

- Many user-level threads mapped to single kernel thread
- One thread blocking causes all to block
- Multiple threads may not run in parallel on multicore system because only one may be in kernel at a time
- Few systems currently use this model
- Examples: Solaris Green Threads, GNU Portable Treads
One-to-One

- Each user-level thread maps to kernel thread
- Creating a user-level thread creates a kernel thread
- More concurrency than many-to-one
- Number of threads per process sometimes restricted due to overhead
- Examples: Windows, Linux
Many-to-Many

- Allows many user level threads to be mapped to many kernel threads
- Allows the operating system to create a sufficient number of kernel threads
- Examples: Windows with ThreadFiber Package (otherwise its not common)
Two-level Model

- Similar to Many-to-Many, except that it allows a user thread to be bound to kernel thread