



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
THIS TOPIC COVERED DEADLOCK,DELETION & RECOVERY SYSTEM OF COMPUTER OPERATING SYSTEM. THE STUDENTS CAN CLEAR THEIR CONCEPT OF OS HOW TO FUNCTION MULTIPLE OPERATIONS & HOW IT'S AFFECT OUR REGULAR WORK IN COMPUTER. THERE ARE ALSO MEMORY MANAGEMENT NOTES ALSO IT'S HELP HOW TO MANAGE THE MEMORY & HOW IT'S WORKS.
Typology: Study notes
1 / 6
This page cannot be seen from the preview
Don't miss anything!
An edge from Pi to Pj in a wait-for graph implies that process Pi is waiting for process Pj to release a resource that Pi needs. An edge Pi to Pj exists in a wait-for graph if and only if the corresponding resource allocation graph contains two edges Pi to Rq and Rq to Pj for some resource Rq.
For example, consider the previous figure. We represent a RAG and corresponding Wait-for graph. A system is in deadlock state, if and only if the wait for graph contains cycles. So we can detect the deadlocks with cycles. In the figure there is 2 cycles one is P1 to P2 to P1. second one P2 to P3 to P2. so the system consisting of two deadlocks.
then process Pi is requesting k more instances of resource type. Rj****.
Allocation Request Available A B C A B C A B C P 0 0 1 0 0 0 0 0 0 0 P 1 2 0 0 2 0 2 P 2 3 0 3 0 0 0 P 3 2 1 1 1 0 0 P 4 0 0 2 0 0 2 Sequence < P 0 , P 2 , P 3 , P 1 , P 4 > will result in Finish [ i ] = true for all i.
P 2 requests an additional instance of type C. Request A B C P 0 0 0 0 P 1 2 0 1 P 2 0 0 1 P 3 1 0 0 P 4 0 0 2
State of system? Can reclaim resources held by process P 0 , but insufficient resources to fulfill other processes; requests. Deadlock exists, consisting of processes P 1 , P 2 , P 3 , and P 4.
There are two methods for breaking a deadlock. One solution is simply to abort one by one processes to break the circular wait. The second option is to preempt some resources from one or more of the deadlocked process.
Process Termination : it is one method to recover from deadlock. We use one of two methods for process termination, these are: Abort all deadlocked processes : It means release the all processes in the deadlocked state, and start the allocation from the starting point. It is a great expensive method. Abort one by one process until the deadlock cycle is eliminated : In this method first abort the one of the processes in the deadlocked state, and allocated the resources ( resource from abort process) to some other process in the deadlocked state then check whether the deadlock is breaked or not. If not abort another process from the deadlock state. Continue this process until we recover from deadlock. This method is less expensive than first.
Resource Preemption: there are three methods to eliminate deadlocks using resource preemption. These are: Selecting a Victim: Select a victim resource from the deadlock state, and preempt that one. Minimize cost. Rollback: Rollback the processes and resources unto some safe state, and restart it from that state. This method requires the system to keep more information about the state of all the running processes. Return to some safe state, restart process for that state.
Starvation: a process (or) a resources can be picked as a victim only a finite number of times, it is said to be starvation. The most common solution is to include the number of rollbacks in the cost factor. same process may always be picked as victim, include number of rollback in cost factor