In an operating system, a deadlock occurs when a process or thread enters a waiting state because a requested system resource is held by another waiting process, which in turn is waiting for another resource held by another waiting process.
Two types of deadlocks can be considered:
1. Resource Deadlock
Occurs when processes are trying to get exclusive access to devices, files, locks, servers, or other resources.
In Resource deadlock model, a process waits until it has received all the resources that it has requested.
The resource model is also called the AND model. In this model, a deadlock occurs if and only if there is a cycle of waiting processes, each dependent on the next process in the cycle to make progress.
Possible situation: Transaction-processing scenario
2. Communication Deadlock
Also referred to as Communication deadlock model, occurs when process A is trying to send a message to process B, which is trying to send a message to process C which is trying to send a message to A.
The communication deadlock model is also called OR model.
Evidently, it easily satisfies the Circular-wait condition for deadlock to occur.
Possible situation: Message-passing scenario
No comments:
Post a Comment