1) A deadlock occurs when a set of processes are blocked waiting for resources held by other processes in the set, forming a circular wait.
2) For a deadlock to occur, four necessary conditions must be met: mutual exclusion, hold and wait, no preemption, and circular wait.
3) Deadlocks can be prevented by ensuring that at least one of the four conditions is not met, such as allowing resource preemption or requiring processes request all resources before starting. Deadlock avoidance uses algorithms like Banker's Algorithm to prevent unsafe states that could lead to deadlock.
The Deadlock Problem
System Model
Deadlock Characterization
Methods for Handling Deadlocks
Deadlock Prevention
Deadlock Avoidance
Deadlock Detection
Recovery from Deadlock
Topic: I/O Buffering in Operting System
Discussion Points:
-Why we need buffering?
-Problems in buffering
-Types of I/O Devices
-Types of Buffer
-Types of approaches to buffering
-Which type of buffer is used with which type of I/O device and how?
The Deadlock Problem
System Model
Deadlock Characterization
Methods for Handling Deadlocks
Deadlock Prevention
Deadlock Avoidance
Deadlock Detection
Recovery from Deadlock
Topic: I/O Buffering in Operting System
Discussion Points:
-Why we need buffering?
-Problems in buffering
-Types of I/O Devices
-Types of Buffer
-Types of approaches to buffering
-Which type of buffer is used with which type of I/O device and how?
Introduction to Database Management SystemsAdri Jovin
This presentation contains content relevant to the introduction to the database management systems. The content is adapted from the original work of Abe Silberschatz et. al.
In this presentation i explain about the most important thing in operating system i.e Deadlock. Here i briefly explained what is deadlock, why deadlock occurs, deadlock in real life, methods of handling deadlock. Banker's algorithm and a numerical.
I hope its worth sharing!
Deadlocks-An Unconditional Waiting Situation in Operating System. We must make sure of This concept well before understanding deep in to Operating System. This PPT will understands you to get how the deadlocks Occur and how can we Detect, avoid and Prevent the deadlocks in Operating Systems.
A brief introduction to Process synchronization in Operating Systems with classical examples and solutions using semaphores. A good starting tutorial for beginners.
Distributed Deadlock & Recovery Deadlock concept, Deadlock in Centralized systems, Deadlock in Distributed Systems – Detection, Prevention, Avoidance, Wait-Die Algorithm, Wound-Wait algorithm Recovery in DBMS - Types of Failure, Methods to control failure, Different techniques of recoverability, Write- Ahead logging Protocol, Advanced recovery techniques- Shadow Paging, Fuzzy checkpoint, ARIES, RAID levels, Two Phase and Three Phase commit protocols
Transaction processing means dividing information processing up into individual, indivisible operations, called transactions, that complete or fail as a whole; a transaction can't remain in an intermediate, incomplete, state (so other processes can't access the transaction's data until either the transaction has
In these slides I discussed about deadlock,causes of deadlock,effects of deadlock,conditions of deadlock,resource allocation graph,deadlock handling strategies,deadlock prevention,deadlock avoidance,deadlock avoidance and resolution....I haven't touch algorithms section in these slides.....and last thing I want to say that don't forget to follow me...
Introduction to Database Management SystemsAdri Jovin
This presentation contains content relevant to the introduction to the database management systems. The content is adapted from the original work of Abe Silberschatz et. al.
In this presentation i explain about the most important thing in operating system i.e Deadlock. Here i briefly explained what is deadlock, why deadlock occurs, deadlock in real life, methods of handling deadlock. Banker's algorithm and a numerical.
I hope its worth sharing!
Deadlocks-An Unconditional Waiting Situation in Operating System. We must make sure of This concept well before understanding deep in to Operating System. This PPT will understands you to get how the deadlocks Occur and how can we Detect, avoid and Prevent the deadlocks in Operating Systems.
A brief introduction to Process synchronization in Operating Systems with classical examples and solutions using semaphores. A good starting tutorial for beginners.
Distributed Deadlock & Recovery Deadlock concept, Deadlock in Centralized systems, Deadlock in Distributed Systems – Detection, Prevention, Avoidance, Wait-Die Algorithm, Wound-Wait algorithm Recovery in DBMS - Types of Failure, Methods to control failure, Different techniques of recoverability, Write- Ahead logging Protocol, Advanced recovery techniques- Shadow Paging, Fuzzy checkpoint, ARIES, RAID levels, Two Phase and Three Phase commit protocols
Transaction processing means dividing information processing up into individual, indivisible operations, called transactions, that complete or fail as a whole; a transaction can't remain in an intermediate, incomplete, state (so other processes can't access the transaction's data until either the transaction has
In these slides I discussed about deadlock,causes of deadlock,effects of deadlock,conditions of deadlock,resource allocation graph,deadlock handling strategies,deadlock prevention,deadlock avoidance,deadlock avoidance and resolution....I haven't touch algorithms section in these slides.....and last thing I want to say that don't forget to follow me...
A deadlock in OS is a situation in which more than one process is blocked because it is holding a resource and also requires some resource that is acquired by some other process
Discuss 4 conditions for deadlocks and 4 deadlock prevention techniques. Solutions like Ostrich Algorithm, and detection techniques with 1 resource type. Deadlock recovery and avoidance.
0x01 - Newton's Third Law: Static vs. Dynamic AbusersOWASP Beja
f you offer a service on the web, odds are that someone will abuse it. Be it an API, a SaaS, a PaaS, or even a static website, someone somewhere will try to figure out a way to use it to their own needs. In this talk we'll compare measures that are effective against static attackers and how to battle a dynamic attacker who adapts to your counter-measures.
About the Speaker
===============
Diogo Sousa, Engineering Manager @ Canonical
An opinionated individual with an interest in cryptography and its intersection with secure software development.
This presentation, created by Syed Faiz ul Hassan, explores the profound influence of media on public perception and behavior. It delves into the evolution of media from oral traditions to modern digital and social media platforms. Key topics include the role of media in information propagation, socialization, crisis awareness, globalization, and education. The presentation also examines media influence through agenda setting, propaganda, and manipulative techniques used by advertisers and marketers. Furthermore, it highlights the impact of surveillance enabled by media technologies on personal behavior and preferences. Through this comprehensive overview, the presentation aims to shed light on how media shapes collective consciousness and public opinion.
This presentation by Morris Kleiner (University of Minnesota), was made during the discussion “Competition and Regulation in Professions and Occupations” held at the Working Party No. 2 on Competition and Regulation on 10 June 2024. More papers and presentations on the topic can be found out at oe.cd/crps.
This presentation was uploaded with the author’s consent.
Acorn Recovery: Restore IT infra within minutesIP ServerOne
Introducing Acorn Recovery as a Service, a simple, fast, and secure managed disaster recovery (DRaaS) by IP ServerOne. A DR solution that helps restore your IT infra within minutes.
2. What is dead lock
In multiprogramming environment , several processes
compete for resources. A situation may arise where a
process is waiting for resources that is held by other
waiting processes. This situation is called a dead lock.
2
3. Deadlock is defined as a situation where set of
processes are blocked because
each process holding a resource and waiting to
acquire a resource held by another process,
A deadlock happens in operating system when two or
more processes need some resource to complete
their execution that is held by the other process.
3
4. Deadlock…
Consider an example when two trains/ vehicle are coming toward
each other on same track and there is only one track, none of the
trains can move once they are in front of each other.
Similar situation occurs in operating systems.
4
5. Note:
A process in operating systems uses different resources , the resources are
used in the following way.
1) Requests a resource
2) Use the resource
2) Releases the resource
5
7. Dead lock….
In the above diagram, the process 1 has resource 1 and needs to
acquire resource 2.
Similarly process 2 has resource 2 and needs to acquire resource 1.
Process 1 and process 2 are in deadlock as each of them needs the
other’s resource to complete their execution but neither of them is
willing to release their resources.
7
8. Deadlock Example
One process has access to printer but is waiting for tap drive ,
while another process has access to tape drive but is waiting for
printer.
8
9. Resources
A resources is an object that is used by a process. It can be a piece of hardware
such as
Tape drive
Printer
Scanner
Buffers
Memory etc.
9
10. Types of Resources
1) Pre-emptible Resources :
A Pre-emptible Resource is one that can be allocated to a given process for a
period of time. Then it can be allocated to another process. Then its can reallocated
to the first process without any negative effects.
Example: memory, buffers etc.
2) Non Pre-emptible Resources :
A Non Pre-emptible Resource cannot be taken from one process and given to
another without side effects.
One example is printer. A printer cannot be taken away from one process and given
to another process in the middle of a print job.
Note: Deadlocks usually involve Non Pre-emptible Resources.
10
11. 6.3 Deadlock Characterization
Deadlock can arise if following four conditions take place
simultaneously in a system. (Necessary Conditions)
1) Mutual Exclusion
2) Hold and Wait
3) No Preemption
4) Circular Wait
11
12. Deadlock Characterization
1) Mutual Exclusion: Only one process at a time can use a
resource. If another process request that resources the
requesting process will delayed until the resource has
been released .
In the diagram below, there is a single instance of Resource
1 and it is held by Process 1 only.
12
13. 2) Hold and Wait: A process must be holding at least one
resource and waiting to acquire additional resources that are
concurrently being held by other processes.
In the diagram given above, Process 2 holds Resource 2 and
Resource 3 and is requesting the Resource 1 which is held by
Process 1.
13
14. 3) No preemption: A resource can be released only voluntarily
by the process holding it, after that process has completed its
task. OR
A resource cannot be preempted from a process by force. A
process can only release a resource voluntarily.
In the diagram, Process 2 cannot preempt Resource 1 from Process
1. It will only be released when Process 1 release it voluntarily
after its execution is complete.
14
15. 4) Circular Wait:
There exists a set {P0, P1, …, Pn} of waiting processes
such that P0 is waiting for a resource that is held by P1, P1
is waiting for a resource that is held by P2, …, Pn–1 is
waiting for a resource that is held by
Pn, and Pn is waiting for a resource that is held by P0.
15
16. OR
A process is waiting for the resource held by the
second process, which is waiting for the resource
held by the third process and so on, till the last
process is waiting for a resource held by the first
process. This forms a circular chain..
16
17. For example: Process 1 is allocated Resource2 and it is
requesting Resource 1. Similarly, Process 2 is allocated
Resource 1 and it is requesting Resource 2. This forms a
circular wait loop
17
18. Deadlock Detection
A deadlock can be detected by a resource scheduler as it
keeps track of all the resources that are allocated to
different processes. After a deadlock is detected, it can be
resolved using the following methods
All the processes that are involved in the deadlock are
terminated. This is not a good approach as all the progress
made by the processes is destroyed.
Resources can be preempted from some processes and given
to others till the deadlock is resolved.
18
19. Method for Handling Deadlocks
1. Deadlock Prevention
2. Deadlock Avoidance
3. Deadlock Detection and Recovery
19
20. Deadlock Prevention
We can prevent deadlocks by ensuring that at least one of the four
necessary conditions for deadlock cannot occur. If at least one condition is
not satisfied, a deadlock will not occur.
20
21. Deadlock Prevention…..
1) Mutual Exclusion
Mutual exclusion condition must hold for non-sharable resources.
For example, only one process can have access to a printer at a time, otherwise
the output is disturbed.
Some resources can be made sharable like a read-only file.
Several processes can be granted read- only access to a file without interfering
with each other.
However, deadlock cannot be prevented by only denying the mutual exclusion
condition because some resources are intrinsically (by birth) non-sharable.
21
22. Deadlock Prevention…..
Elimination of Mutual Exclusion
If it is shareable resource, then we can break the mutual exclusion (such as:
Read-only file)
If it is not a shareable resource, then mutual exclusion must hold (such as:
Printer) because non shareable means that their states cannot be saved and
restored without ill effects.
22
23. Deadlock Prevention…..
2) Elimination of Hold and wait: two methods
A) Require process to request and be allocated all its resources before it begins
execution.
B) Allow process to request resources only when the process has none.
Example:
We consider a process that copies data from DVD drive to a picture file on disk
and then prints the picture to a printer
Method 1: Request DVD drive, Disk, and Printer before it execute. It will hold
the Printer for entire execution, even though it needs the printer only at the end.
Method2: Request only for DVD drive and Disk initially. It finishes the copy step
and releases both resources. The process must then again ask for disk and printer
To finish the job.
23
24. Deadlock Prevention…..
3) Elimination of No preemption:
a) Release any resource already being held if the process can't get an
additional resource.
b) Allow preemption - if a needed resource is held by another process,
which is also waiting on some resource, steal it. Otherwise wait.
c) Process will be restarted only when it can regain its old Resources, as
well as the new ones that it is requesting.
24
25. Deadlock Prevention…..
4) Elimination of Circular wait
Each resource will be assigned with a numerical number. A process
can request the resources only in increasing order of numbering.
For Example,
if P1 process is allocated R5 resources, now next time if P1 ask for
R4, R3 lesser than R5 such request will not be granted, only request
for resources more than R5 will be granted.
25
26. Deadlock Avoidance
Deadlock avoidance can be done with help of Banker’s Algorithm.
Banker’s Algorithm:
Bankers' 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.
26
27. Safe State and Unsafe State
A state is said to be a safe state if the system may allocate
the required resources to each process up to the maximum
required in a particular sequence without facing deadlock.
In safe state , deadlock cannot occur.
If a deadlock is possible the system is said to be in an
unsafe state.
The idea of avoiding a deadlock is to simply not allow the
system to enter an unsafe state that may cause a deadlock
27
28. Inputs to Banker’s Algorithm:
1) Max need of resources by each process.
2) Currently allocated resources by each
process.
3) Max free available resources in the
system.
28