User-Level Threads (ULT)
Advantages and inconveniences of ULT
Advantages:
- Thread switching does not involve the kernel -- no mode switching
- Scheduling can be application specific -- choose the best algorithm.
- ULTs can run on any OS -- Only needs a thread library
Disadvantages:
- Most system calls are blocking and the kernel blocks processes -- So all threads within the process will be blocked
- The kernel can only assign processes to processors -- Two threads within the same process cannot run simultaneously on two processors
Kernel-Level Threads (KLT)
In this level, All thread management is done by kernel No thread library but an API (system calls) to the kernel thread facility exists. The kernel maintains context information for the process and the threads, switching between threads requires the kernel Scheduling is performed on a thread basis.Advantages and inconveniences of KLT
Advantages
- the kernel can simultaneously schedule many threads of the same process on many processors blocking is done on a thread level
- kernel routines can be multithreaded
Disadvantages:
- thread switching within the same process involves the kernel, e.g if we have 2 mode switches per thread switch this results in a significant slow down.
No comments:
Post a Comment