![]() You can't get a job without experience you can't get experience without a job. DEADLOCKS EXAMPLES: 'It takes money to make money'. P1 and P2 each hold one tape drive and each needs the other one. Today: Deadlocks What are deadlocks Conditions for deadlocks Deadlock prevention Deadlock detection 3 Computer Science CS377: Operating Systems Lecture 10, page Deadlocks Deadlock: A condition where two or more threads are waiting for an event that can only be generated by these same threads. OPERATING SYSTEM Deadlocks What Is In This Chapter What is a deadlock Staying Safe: Preventing and Avoiding Deadlocks Living Dangerously: Let the deadlock happen, then detect it and recover from it. "Deadlock" by Multiple Contributors, Wikipedia is licensed under CC BY-SA 3. The Deadlock Problem A set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set. The resources held by those processes are released by terminating the processes, allowing other processes to proceed. In this approach, the operating system terminates one or more processes involved in the deadlock. Watch - when the yellow lines, representing the locking mechanism, are different on each side then we have a method to break the deadlock and allow the left side process tom complete and freeing up the resource for the right and resource to complete. There are two primary approaches for deadlock recovery: 1. In the above image notice the yellow line - if it is the same on both sides, a deadlock can develop (scenario A shows that one process gets there is difficult to see in the gif - but that is why there is NOT a deadlock - first come - first serve). ( "Avoiding Deadlock" by Wikimedia Commons is licensed under CC BY-SA 4.0) (D) The deadlock can be avoided by breaking the symmetry of the locking mechanism. The execution of two or more processes is blocked because each process holds some resource and waits for another resource held by some other process. (C) The deadlock can be resolved by breaking the symmetry of the locks. (B) A deadlock occurs when both processes lock the resource simultaneously. OS may preempt the second process and require it to release its resources (practical. ![]() \): (A) Two processes concurring for one resource, following a first-come, first-served policy.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |