Вы находитесь на странице: 1из 17

DeadLock

>< Why When How ><


Presented By
Mubeen(Group Head)
Opportunity Given By
Zabihullah,Ramiz,Ammar Miss Farheen Faisal

Muhammad Mubeen
Topic
Working hard to minimize the distance between what am I and What I want to be

Skills
Php Javascript 60%
Deadlock C# 40%
CSS 3 60%
Photoshop 70%
Agenda
01 DeadLock (Its Intro & How It Comes )

02 Deadlock Types

03 Deadlock Prevention
Conceptual level

Deadlock? Oh that is deadlock REAL concept Oh sorry now I really


understood

1 2 3 4
Intro

A deadlock is a situation in which two computer programs


sharing the same resource are effectively preventing each
other from accessing the resource, resulting in both
programs ceasing to function
Computer Deadlock because
Computer enhances its area and different users( Continuously )
Previously computers was used for single type of task

Everything was out side of Computer

Travelling

Studying
For business Computer
For getting job
For enjoyment

Watching
For learning
Business For entertainment
etc
Human DEADLock@??
Seems strange I will Explain

(Ak tang)
A man can move upward Ak
tang at a time.

{ }
Human DEADLock@??

Store many do Interact many do one


many

Interact many do one Interact many do one


Human Interactions

And computer interaction behavior


Utilize a resource
Each process as follows:

Request Release Next


If completed Released
By human/machine
We don’t care, can be
used by some other
process

Use
If possible
Methods for Handling
Deadlocks Handling
• Ensure that the system will never enter a deadlock
state:
• Deadlock prevention
• Deadlock avoidance
• Allow the system to enter a deadlock state and then
recover
• Ignore the problem and pretend that deadlocks never
occur in the system; used by most operating systems,
including Windows, UNIX etc
Deadlock Conditions
Mutual Exclusion

Hold and Wait:

Circular Wait:

No Pre-emption:
Deadlock Conditions
1. Mutual exclusion condition
• each resource assigned to 1 process or is available
2. Hold and wait condition
• process holding resources can request additional
3. No preemption condition
• previously granted resources cannot forcibly taken
away
4. Circular wait condition
• must be a circular chain of 2 or more processes
• each is waiting for resource held by next member of
the chain
Deadlock Prevention
As we need
Exclusive access to devices, files, locks, servers,
or other resources

Basically Deadlock prevention:


When multiple processes must acquire more
than one shared resources; As a result, none of
the processes can obtain all the resources it
needs then we go to
Deadlock prevention
Deadlock Prevention
• Mutual Exclusion
• not required for sharable resources
(e.g., read-only files);
• must hold for non-sharable resources
Spool: Transfer to memory store for later processing

• Hold and Wait – must guarantee that whenever a


process requests a resource, it does not hold any other
resources
• Require process to request and be allocated all its resources
before it begins execution, or allow process to request
resources only when the process has none allocated to it.
• Low resource utilization; starvation possible
Deadlock Prevention
• No Preemption –
• If a process that is holding some resources requests another resource
that cannot be immediately allocated to it, then all resources currently
being held are released
• Preempted resources are added to the list of resources for which the
process is waiting
• Process will be restarted only when it can regain its old resources, as
well as the new ones that it is requesting

• Circular Wait – impose a total ordering of all resource types,


and require that each process requests resources in an
increasing order of enumeration
Thank You
Keep learning not just studying

ALLPPT

Вам также может понравиться