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
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
The objectives of Deadlocks in Operating Systems are:
- To develop a description of deadlocks, which prevent sets of concurrent processes from completing their tasks
- To present a number of different methods for preventing or avoiding deadlocks in a computer system
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
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
The objectives of Deadlocks in Operating Systems are:
- To develop a description of deadlocks, which prevent sets of concurrent processes from completing their tasks
- To present a number of different methods for preventing or avoiding deadlocks in a computer system
Deadlocks operating system To develop a description of deadlocks, which prevent sets of concurrent processes from completing their tasks
To present a number of different methods for preventing, avoiding, or detecting deadlocks in a computer system
e.t.c
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...
Deadlocks operating system To develop a description of deadlocks, which prevent sets of concurrent processes from completing their tasks
To present a number of different methods for preventing, avoiding, or detecting deadlocks in a computer system
e.t.c
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...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Dr.Costas Sachpazis
Terzaghi's soil bearing capacity theory, developed by Karl Terzaghi, is a fundamental principle in geotechnical engineering used to determine the bearing capacity of shallow foundations. This theory provides a method to calculate the ultimate bearing capacity of soil, which is the maximum load per unit area that the soil can support without undergoing shear failure. The Calculation HTML Code included.
Democratizing Fuzzing at Scale by Abhishek Aryaabh.arya
Presented at NUS: Fuzzing and Software Security Summer School 2024
This keynote talks about the democratization of fuzzing at scale, highlighting the collaboration between open source communities, academia, and industry to advance the field of fuzzing. It delves into the history of fuzzing, the development of scalable fuzzing platforms, and the empowerment of community-driven research. The talk will further discuss recent advancements leveraging AI/ML and offer insights into the future evolution of the fuzzing landscape.
Forklift Classes Overview by Intella PartsIntella Parts
Discover the different forklift classes and their specific applications. Learn how to choose the right forklift for your needs to ensure safety, efficiency, and compliance in your operations.
For more technical information, visit our website https://intellaparts.com
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
Water scarcity is the lack of fresh water resources to meet the standard water demand. There are two type of water scarcity. One is physical. The other is economic water scarcity.
Quality defects in TMT Bars, Possible causes and Potential Solutions.PrashantGoswami42
Maintaining high-quality standards in the production of TMT bars is crucial for ensuring structural integrity in construction. Addressing common defects through careful monitoring, standardized processes, and advanced technology can significantly improve the quality of TMT bars. Continuous training and adherence to quality control measures will also play a pivotal role in minimizing these defects.
About
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Technical Specifications
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
Key Features
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface
• Compatible with MAFI CCR system
• Copatiable with IDM8000 CCR
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
Application
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Explore the innovative world of trenchless pipe repair with our comprehensive guide, "The Benefits and Techniques of Trenchless Pipe Repair." This document delves into the modern methods of repairing underground pipes without the need for extensive excavation, highlighting the numerous advantages and the latest techniques used in the industry.
Learn about the cost savings, reduced environmental impact, and minimal disruption associated with trenchless technology. Discover detailed explanations of popular techniques such as pipe bursting, cured-in-place pipe (CIPP) lining, and directional drilling. Understand how these methods can be applied to various types of infrastructure, from residential plumbing to large-scale municipal systems.
Ideal for homeowners, contractors, engineers, and anyone interested in modern plumbing solutions, this guide provides valuable insights into why trenchless pipe repair is becoming the preferred choice for pipe rehabilitation. Stay informed about the latest advancements and best practices in the field.
Welcome to WIPAC Monthly the magazine brought to you by the LinkedIn Group Water Industry Process Automation & Control.
In this month's edition, along with this month's industry news to celebrate the 13 years since the group was created we have articles including
A case study of the used of Advanced Process Control at the Wastewater Treatment works at Lleida in Spain
A look back on an article on smart wastewater networks in order to see how the industry has measured up in the interim around the adoption of Digital Transformation in the Water Industry.
1. Operating Systems: Deadlock
1
Deadlock
• Examples: Traffic Jam :
• Dining Philosophers
• Device allocation
– process 1 requests tape drive 1 & gets it
– process 2 requests tape drive 2 & gets it
– process 1 requests tape drive 2 but is blocked
– process 2 requests tape drive 1 but is blocked
• Semaphores : P(s) P(t)
P(t) P(s)
2. Operating Systems: Deadlock
2
• I/O spooling disc
– disc full of spooled input
– no room for subsequent output
• Over-allocation of pages in a virtual memory OS
– each process has a allocation of notional pages it must work within
– process acquires pages one by one
– normally does not use its full allocation
– kernel over-allocates total number of notional pages
» more efficient uses of memory
» like airlines overbooking seats
– deadlock may arise
» all processes by mischance approach use of their full allocation
» kernel cannot provide last pages it promised
» partial deadlock also - some processes blocked
– recovery ?
3. Operating Systems: Deadlock
3
• Resource:
– used by a single process at a single point in time
– any one of the same type can be allocated
• Pre-emptible:
– can be taken away from a process without ill effect
– no deadlocks with pre-emptible resources
• Non-Pre-emptible:
– cannot be taken away without problems
– most resources like this
– deadlock possible
4. Operating Systems: Deadlock
4
Definition : A set of processes is deadlocked if each process in the set is
waiting for an event that only another process in the set can cause
Necessary conditions for deadlock :
• Mutual Exclusion : each resource is either currently assigned to one
process or is available to be assigned
• Hold and wait : processes currently holding resources granted earlier can
request new resources
• Non-Pre-emption : resources previously granted cannot arbitrarily be
taken away from a process; they must be explicitly released by the process
• Circular wait : there must be a circular chain of two or more processes,
each of which is waiting for a resource held by the next member of the chain
8. Operating Systems: Deadlock
8
• For multiple resources of the same type :
• Deadlock :
• A cycle not sufficient to
imply a deadlock :
9. Operating Systems: Deadlock
9
Possible Strategies :
• Ignore - the Ostrich or Head-in-the-Sand algorithm
– try to reduce chance of deadlock as far as reasonable
– accept that deadlocks will occur occasionally
» example: kernel table sizes - max number of pages, open files etc.
– MTBF versus deadlock probability ?
– cost of any other strategy may be too high
» overheads and efficiency
10. Operating Systems: Deadlock
10
• Deadlock Prevention
– negate one of the necessary conditions
• negating Mutual Exclusion :
– example: shared use of a printer
» give exclusive use of the printer to each user in turn wanting to print?
» deadlock possibility if exclusive access to another resource also allowed
» better to have a spooler process to which print jobs are sent
- complete output file must be generated first
– example: file system actions
» give a process exclusive access rights to a file directory
» example: moving a file from one directory to another
- possible deadlock if allowed exclusive access to two directories simultaneously
- should write code so as only to need to access one directory at a time
– solution?
» make resources concurrently sharable wherever possible e.g. read-only access
» most resources inherently not sharable!
13. Operating Systems: Deadlock
13
• negating Hold and Wait
– process could request all the resources it will ever need at once
» inefficient - not all resources needed all the time
» processes probably will not know in advance what resources they will need
» may have to wait excessive time to get all resources at once - starvation
- high priority processes may cause starvation of low priority processes
14. Operating Systems: Deadlock
14
– process could release existing resources it holds if it fails to get a new
resource immediately
» try again later
» a form of two phase locking used in databases
– whenever a new resource is needed, the process always releases its
existing resources and asks for all of them at once
– example: a process which copies a file from tape to disc, sorts the file on
disc, and then prints the results on a printer
» could request all three resources at the start
- wasteful of printer first, then tape drive later
» could initially request tape and disc together, do the read and sort, then
release both and finally request disc and printer together to do the printing
- more efficient
- must ensure data stays intact on disc between phases
15. Operating Systems: Deadlock
15
• negating Non-Pre-emption
– difficult to achieve in practice
» cannot take a printer away from a process in the middle of printing
» cannot take a semaphore away from a process arbitrarily
- might be in the middle of updating a shared area
» cannot take open streams, pipes and sockets away
- process would need to be written very carefully, probably using signals
- very undesirable if possible at all
– occasionally possible :
» processes resident in main memory
» some deadlock occurs such as failure to allocate a page
» one or more processes can be swapped out to disc to release their pages
and allow remaining processes to continue
- as long as they release any other resources they also hold on the way out
» put back on the scheduling queues to be re-admitted to memory later
16. Operating Systems: Deadlock
16
• negating Circular Wait
– require that a process can only acquire one resource at a time
» example: moving a file from one directory to another
– require processes to acquire resources in a certain order
– example:
» 1: tape drive
» 2: disc drive
» 3: printer
» 4: plotter
» 5: typesetter
– example: semaphores
» semaphores identified by
number claimed in numerical order
17. Operating Systems: Deadlock
17
• Deadlock Avoidance
– deadlock possible but avoided by careful allocation of resources
– avoid entering unsafe states
– a state is safe if it is not deadlocked and there is a way to satisfy all requests
currently pending by running the processes in some order
– need to know all future requests of processes
18. Operating Systems: Deadlock
18
• Example: can processes run to completion in some order?
– with 10 units of resource to allocate :
– if A runs first and acquires a further unit :
19. Operating Systems: Deadlock
19
• avoidance using resource allocation graphs - for one instance resources
– add an extra type of arc - the claim arc to indicate future requests
– when the future request is actually made, convert this to an allocation arc
– then check for loops
20. Operating Systems: Deadlock
20
Banker’s Algorithm (Dijkstra)
• Single resource
– at each request, consider whether granting will lead to an unsafe state - if so,
deny
– is state after the notional grant still safe?
» are there enough resources to satisfy the demands of some process
» if so, process is notionally allowed to proceed
» in due course, it is assumed to finish and return all its resources
» process closest to its limit is the checked, and the steps repeated
» if all processes can eventually run to completion, state is safe
21. Operating Systems: Deadlock
21
• Multiple resources
– m types of resource, n processes
– vector comparison :
» A B if Ai Bi for 0 i m
22. Operating Systems: Deadlock
22
» look for a row in R A i.e. a process whose requests can be met
» if no such row exists, state is unsafe
» add this row of R into the same row of C and subtract it from A
i.e. notionally allocate the resources to the process
» add this row of C back into A and set the row of C to zero i.e. the process
notionally completes and returns its resources
» repeat these steps until all C is all zero i.e. all processes notionally finished
(initial state is safe) or until a suitable row in R cannot be found (unsafe)
C R
23. Operating Systems: Deadlock
23
Drawbacks of Banker’s Algorithm
– processes rarely know in advance how many resources they will need
– the number of processes changes as time progresses
– resources once available can disappear
– the algorithm assumes processes will return their resources within a
reasonable time
– processes may only get their resources after an arbitrarily long delay
– practical use is therefore rare!
24. Operating Systems: Deadlock
24
• Detection and Recovery
– let deadlock occur, then detect and recover somehow
• Methods of Detection - single resources
– search for loops in resource allocation graph
25. Operating Systems: Deadlock
25
• Depth-first Graph search
– use a list of nodes L and progressively mark arcs
1. For each node N in the graph, perform steps 2-6 with N as starting node
2. Initialise L to empty and designate all arcs as unmarked
3. Add current node to L
» check if node appears twice in L
» if so, graph contains a cycle - algorithm terminates
4. From given node, if there are any unmarked outgoing arcs, goto 5
else goto 6
5. Pick an unmarked outgoing arc and mark it
» follow it to new current node and goto 3
6. Have reached a dead end
» go back to previous node and goto 4
» if this node is the initial node, graph does not contain cycles and
algorithm terminates
29. Operating Systems: Deadlock
29
• Warshall’s Algorithm for computing Transitive Closure :
– if there is a way to get from node x to node y and a way to get from node y to node z, then
there is a way to get from node x to node z
– if there is a way to get from node x to node y using only nodes with indices less than x and a
way to get from node y to node z , then there is a way to get from from node x to node z using
only nodes with indices less than x+1
for (y=0; y<N; y++) {
for (x=1; x<N; x++) {
if ( A[x,y] ) {
for (z=1; z<N; z++) {
if ( A[y,z] ) A[x.z] = true;
}
}
}
}
31. Operating Systems: Deadlock
31
• Multiple resources
– apply equivalent of Banker’s algorithm using current resource requests
– any processes unsatisfied are deadlocked
• When to check for deadlock?
– every time a resource request is made
– regularly at fixed time intervals
– when CPU utilisation drops below some threshold
32. Operating Systems: Deadlock
32
Recovery from Deadlock
• Pre-emption
– take resources from a process and give to others
– how to select a victim?
» order of precedence for pre-empting
» number of resources already held
» how many more will it need to complete?
» amount of CPU time already used
– swapping process out of memory may be sufficient
» but may still hold resources involved in deadlock
– may need to roll pre-empted process back
» back to some safe restart point or go back to beginning
» may need to checkpoint processes
» not convenient for user interaction!
– need to avoid starvation of a low priority process always being pre-empted
» include number of previous pre-emptions as a choice factor
33. Operating Systems: Deadlock
33
• Process Termination
– drastic ultimate solution
– abort all processes involved in the deadlock
» all resources returned for re-use
– abort processes one by one until deadlock resolved
» how to choose order of precedence?
» will the process need to be rerun?
– aborting a process may cause severe difficulties
» may be in the process of updating a file which will be left inconsistent
– a process gets into an infinite program loop while holding resources
» common situation in practice