1. Give one real-life example in Computers of Deadlock
2. How to prevent it from occurring?
1
Expert's answer
2021-11-01T08:51:46-0400
A real-world example would be traffic that only moves in one way. A bridge is seen as a resource in this context. So, if one automobile backs up, a deadlock may be quickly resolved (Preempt resources and rollback). If there is a stalemate, many automobiles may have to be backed up.
To avoid deadlocks, request all essential resources at the same time. In other words, a process may not get one resource before requesting another. If a process has a resource for any reason and its request for another resource is rejected, it must give up the first resource.
Comments
Leave a comment