Thursday, August 20, 2009

Deadlock


5.Deadlock Recovery



•Deadlock must be untangled once detected, so the system returns to normal quickly
•All recovery methods have at least one victim
•Recovery Methods:
–Terminate every job that’s active in the system and restart them from the beginning
–Terminate only the jobs involved in the deadlock and ask their users to resubmit them
–Identify jobs involved in deadlock and terminate them one at a time



–Jobs that keep a record (snapshot) of their progress can be interrupted
–Select a nondeadlocked job, preempt its resources, allocate them to a deadlocked process
–Stop new jobs from entering system, which allows nondeadlocked jobs to run to completion so they’ll release their resources (no victim)




•Select the victim that will have the least-negative effect on the system
•Factors to be considered to select a victim:
–Priority of job under consideration: high-priority jobs are usually untouched
–CPU time used by job: jobs close to completion are usually left alone
–Number of other jobs that would be affected if this job were selected as the victim
–Jobs that are modifying data shouldn’t be selected for termination



-By flushing one or more process that involved in deadlock until there is no deadlock





No comments: