120k views
2 votes
What will happen if a non-recursive mutex is locked more than once ?

a) Starvation
b) Deadlock
c) Aging
d) Signaling

User Sebataz
by
7.5k points

1 Answer

1 vote

Final answer:

If a non-recursive mutex is locked more than once, it will lead to deadlock. Deadlock occurs when two or more threads are waiting for each other to release resources, resulting in a situation where none of the threads can proceed.

Step-by-step explanation:

If a non-recursive mutex is locked more than once, it will lead to deadlock. Deadlock occurs when two or more threads are waiting for each other to release resources, resulting in a situation where none of the threads can proceed.

A non-recursive mutex is designed to be locked by the same thread only once. If the same thread tries to lock the mutex again without releasing it first, it will cause a deadlock.

For example, imagine Thread A locks the mutex, and then Thread A tries to lock it again without releasing it first. This will lead to a deadlock situation where Thread A is waiting for itself to release the mutex, resulting in a complete standstill.

User David Gidony
by
9.3k points