1,467 views
4 votes
4 votes

Degree of concurrency in threads can be arranged in the manner

  1.  One-to-one > many-to-one > many-to-many
  2.  One-to-one > many-to-many > many-to-one
  3.  Many-to-many > many-to-one > one-to-one
  4.  None of the above

answer given is A but according to me answer is B. Someone please confirm

2 Answers

5 votes
5 votes
Answer should be B.

Many to many is model overcomes the disadvantages of one to one and many to one.

In many to one, programmer can make as many threads as she wants. The good thing about this is there is no support required by the OS when switching from one thread to other(switching is fast). The bad thing is all the user threads mapped to one kernel thread cannot be run concurrently even in multiprocessor system. The kernel is not aware of any thread at user level.

In one to one, the good thing is threads can run in parallel in multiprocessor system. Each kernel thread can be run on one processor. The bad thing is the threading concept is totally overlooked. Now switching between threads is a time consuming operation because it involves switching between kernel level threads as well.

 

Operating system by Galvin 9th edition will be a good read.

Related questions

0 votes
0 votes
0 answers
2
admin asked Oct 25, 2019
568 views
Consider a system in which it is desired to separate policy and mechanism for the scheduling of kernel threads. Propose a means of achieving this goal.
0 votes
0 votes
1 answer
3
admin asked Oct 24, 2019
571 views
In a system with threads, is there one stack per thread or one stack per process when user-level threads are used? What about when kernel-level threads are used? Explain....