Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Deadlock Voidance

Deadlock Voidance

Ratings: (0)|Views: 3 |Likes:
Published by zerlin_cute9

More info:

Categories:Types, Research
Published by: zerlin_cute9 on Oct 02, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less

08/28/2013

pdf

text

original

 
Deadlock voidance
 
In deadlock avoidance, deadlocks may occur but the operating system will avoid actions thatcould lead to deadlocks.Unsafe state
 
A state that may lead to deadlock and must be avoided.Safe State
 
A state that has a scheduling order or a sequence of processes in which every process in thesequence can complete its execution.
Deadlock Avoidance
Assume that there are three processes and ten resources of the same type. The Table below shows thecurrent resource allocation.Process Maximum needed Currently HoldingP
1
8 1P
2
5 3P
3
9 3
Banker’s Algorithm
 
 
Used to determine if the current state of the system is safe or not.Example:A system has 4 processes and 10 resources of the same type. Assume the following resource allocationtable.Process Max[i] hold[i]P
1
6 1P
2
5 1P
3
4 2P
4
7 3The values for the variables are:
Need[1]=6-1=5Need[2]=5-2=4Need[3]=4-2=2Need[4]=7-3+4
 Available= 10(1+1+2+3)=3 this is the current state of…..
 
 
Now suppose the p4 makes a request for 1 resource. The temporary new state of the system will beProcess Max[i] hold[i]P
1
6 1P
2
5 1P
3
4 2P
4
7 4The values for the variables are:
Need[1]=6-1=5Need[2]=5-1=4Need[3]=4-2=2Need[4]=7-3+4 Available= 10(1+1+2+3)=2this is give state is safe state.
Now suppose the p2 makes a request for 1 resource. The temporary new state of the system will beProcess Max[i] hold[i]P
1
6 1P
2
5 2P
3
4 2P
4
7 4The values for the variables are:
Need[1]=6-1=5Need[2]=5-2=3Need[3]=4-2=2Need[4]=7-3+4 Available= 10(1+1+2+3)=2this is give state is u safe state.

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->