in Operating System
704 views
0 votes
0 votes
Q. Multithreaded programs are :

A)  lesser prone to deadlocks

B) more prone to deadlocks

C) not at all prone to deadlocks

D) none of the mentioned

I think can we gives ans like that?

threads that are user level, if one of the thread is going be in deadlock , the entire process belonging to that thread is going to blocked (because user level threads are unaware by OS) so can we say optionB) is correct ?
in Operating System
by
704 views

2 Answers

0 votes
0 votes
I think this explanation is somewhat correct, also there could be a condition in which multiple threads can wait for a shared resource which eventually leads to condition of deadlock.
0 votes
0 votes

"threads that are user level, if one of the thread is going be in deadlock , the entire process belonging to that thread is going to blocked (because user level threads are unaware by OS) so can we say option B) is correct ?"

This isn't fully correct. It depends on multithreading model used, like for many to many model.

Number of kernel level threads are specific to the machine, advantage of this model is if a user thread is blocked we can schedule others user thread to other kernel thread. Thus, System doesn’t block if a particular thread is blocked.

For many to one if one thread block whole process is blocked.

Ref: https://www.geeksforgeeks.org/multi-threading-models-in-process-management/

 

So B is correct. But you explanation is wrong.

Related questions