0% found this document useful (0 votes)
3 views9 pages

OS - Lecture 14th

Deadlock avoidance requires processes to declare the maximum number of resources they may need, preventing the system from entering an unsafe state. The Banker’s Algorithm, developed by Edsger Dijkstra, is used to test resource requests and ensure the system remains in a safe state before granting them. This algorithm simulates resource allocation and checks for potential deadlock conditions before allowing processes to proceed.

Uploaded by

noorriaz479
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views9 pages

OS - Lecture 14th

Deadlock avoidance requires processes to declare the maximum number of resources they may need, preventing the system from entering an unsafe state. The Banker’s Algorithm, developed by Edsger Dijkstra, is used to test resource requests and ensure the system remains in a safe state before granting them. This algorithm simulates resource allocation and checks for potential deadlock conditions before allowing processes to proceed.

Uploaded by

noorriaz479
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Operating System

Deadlock Avoidence

 Indeadlock avoidance the


maximum number of resources of
each type that will be needed are
stated at the beginning of the
process.
Deadlock Avoidence

 InDeadlock avoidance we have to


anticipate deadlock before it really
occurs and ensure that the system
does not go in unsafe state.It is
possible to avoid deadlock if
resources are allocated carefully. For
deadlock avoidance we use Banker’s
and Safety algorithm for resource
allocation purpose.
Deadlock Avoidence

 Deadlockavoidance can be done


with Banker’s Algorithm.
Banker’s Algorithm
Banker’s Algorithm

 Bankers’s Algorithm is resource


allocation and deadlock avoidance
algorithm which test all the request
made by processes for resources, it
checks for the safe state, if after
granting request system remains in
the safe state it allows the request
and if there is no safe state it doesn’t
allow the request made by the
process.
Banker’s Algorithm

 TheBanker's algorithm is a
resource allocation and deadlock
avoidance algorithm developed by
Edsger Dijkstra.
Banker’s Algorithm
 The Banker algorithm, sometimes referred
to as the detection algorithm, is a
resource allocation and deadlock avoidance
algorithm developed by Edsger Dijkstra that
tests for safety by simulating the allocation
of predetermined maximum possible
amounts of all resources, and then makes an
"s-state" check to test for possible deadlock
conditions for all other pending activities,
before deciding whether allocation should be
allowed to continue.
Banker’s Algorithm

 When a new process enters a


system, it must declare the
maximum number of instances of
each resource type that it may ever
claim; clearly, that number may not
exceed the total number of
resources in the system. Also, when
a process gets all its requested
resources it must return them in a
finite amount of time.

You might also like