There are two approaches to implement a thread package.
(1) User Level Threads
Threads which are created and handled by thread library are called user level threads.
- OS is unaware of user level threads
- Creation and handling is cheaper as no system calls are needed. Only CPU registers need to be stored and reloaded
- But if one thread is blocked, whole process will get blocked.
- Eg: Pthreads, Mach C-threads, and Solaris 2 UI-threads
(2) Kernel Level thread
Threads which are created and handled by OS are called Kernel Level Threads.
- Managing is expensive as some system calls are needed.
- Kernel Level scheduler schedules threads from all processes. Hence it can distribute threads on different processors/cores.
- Even if one thread is blocked, process will be active. Hence useful if process gets blocked frequently
- Eg: Windows , UNIX
D is false!!