Question

how do the user-level threads map to the kernel threads ?

how do the user-level threads map to the kernel threads ?

0 2
Add a comment Improve this question Transcribed image text
Answer #1

Please focus on the Bold and Underlined parts of the answer.

> What is a Thread ?

A thread is a flow of execution through the process code, with its own program counter that keeps track of which instruction to execute next, system registers which hold its current working variables, and a stack which contains the execution history.A thread is also called a Lightweight Process.

> There are two types of threads to be managed in a modern system :

User threads

Kernel threads.

> How do the user-level threads map to the kernel threads ?

There are two types of processes: user and kernel(OS). Each process can have single or multiple threads. The threads of a user process are called a user-level thread and the threads of a kernel process are called kernel-level threads. Scheduler, dispatcher etc. contains kernel-level threads. Both user-level threads and kernel-level threads can able to run on CPU.

There may be several user-processes in ready queue for execution, scheduler(kernel) decides which user process/ thread to run on CPU, dispatcher(kernel) gives control to the corresponding user-thread on CPU, the corresponding user-thread executes and terminates.

To run on a CPU, user-level threads must ultimately mapped to an associated kernel-level thread.

In general, user-level threads can be implemented using one of four models.

  • Many-to-one
  • One-to-one
  • Many-to-many
  • Two-level

All models maps user-level threads to kernel-level threads. A kernel thread is similar to a process in a non-threaded (single-threaded) system. The kernel thread is the unit of execution that is scheduled by the kernel to execute on the CPU.

Many-to-one

In the many-to-one model all user level threads execute on the same kernel thread. The process can only run one user-level thread at a time because there is only one kernel-level thread associated with the process.

One-to-one

In the one-to-one model every user-level thread execute on a separate kernel-level thread.

Many-to-many

In the many-to-many model the process is allocated m number of kernel-level threads to execute n number of user-level thread.

Please find the related images for more understanding.ma ann Emma cum ☺ user space kernel spacen-1 mo Gunn user space kernel spacesm user space kernel space

Add a comment
Know the answer?
Add Answer to:
how do the user-level threads map to the kernel threads ?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT