0
6.1kviews
Describe deadlock in RTOS with suitable example.
1 Answer
written 6.0 years ago by | • modified 5.9 years ago |
A deadlock consists of a set of blocked processes, each holding a resource and waiting to acquire a resource held by another process in the set
A deadlock, also called as deadly embrace, is a situation in which two threads are each unknowingly waiting for resource held by other.
Example #1 A system has 2 disk drives P1 and P2 each hold one disk drive and each need the other one.
Example #2 Semaphores A and B, initialized to 1
P0 | P1 |
---|---|
wait (A); | wait(B) |
wait (B); | wait(A) |