Name some advantages and disadvantages of user-level threads

      

Name some advantages and disadvantages of user-level threads

  

Answers


Faith
Advantages of user-level threads include:
- Theoretically greater performance, as the OS does not need to perform expensive context switches
every time a thread changes.
- More configurable, as you are not tied to the kernel to decide a scheduling algorithm, nor do you
require kernel support for multiple threads.

Disadvantages of user-level threads include:
- Realistically worse performance, because many threads require a context switch regardless (say a
syscall is called, such as on an I/O event). This will force a switch into kernel mode and BLOCK every
single other user-level thread in that process from running, because the kernel treats the entire user-
space of threads as a single process.
- User level threads are generally co-operative rather than pre-emptive, so must manually yield() to
return control back to the dispatcher – a thread that does not do this may monopolise the CPU.
- I/O must be non-blocking – this requires extra checking just in case there is an action that should block.
- We cannot take advantage of multiprocessors, since the kernel sees one process with one thread.
Titany answered the question on April 26, 2022 at 05:11


Next: Describe how a multi-threaded application can be supported by a user-level threads package. It may be helpful to consider (and draw) the components of such...
Previous: Why are user-level threads packages generally cooperatively scheduled?

View More Operating Systems Questions and Answers | Return to Questions Index


Exams With Marking Schemes

Related Questions