The document discusses deadlock in a multiprogramming environment, where processes may wait indefinitely for resources held by others, leading to blocked execution and performance issues. It outlines the necessary conditions for deadlock, including mutual exclusion, hold and wait, no preemption, and circular wait. The document emphasizes the importance of resource allocation policies and semaphore operations to prevent deadlock situations.
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 ratings0% found this document useful (0 votes)
9 views4 pages
L27
The document discusses deadlock in a multiprogramming environment, where processes may wait indefinitely for resources held by others, leading to blocked execution and performance issues. It outlines the necessary conditions for deadlock, including mutual exclusion, hold and wait, no preemption, and circular wait. The document emphasizes the importance of resource allocation policies and semaphore operations to prevent deadlock situations.
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/ 4
In multiprogramming environment, processes may require physical or logical
resources. Physical resources could be different devices and logical resources
could be files present the computer system. A process requests resources. If the they are not available at that time, a process enters into wait state. It may happen that waiting process will never change the state again because resources requested by the process are occupied by some other process. This is known as dead lock and leads to blocking of process execution.(no progress) Deadlock affects the progress by causing indefinite delays in resources allocation. Processing is blocked and is waiting for events those can not happen. Such delays have serious consequences for the response time of process and performance of the system. Therefore, an operating system shall make use of resource allocation policies that ensures no deadlock in the system. When every process in the set of or collection of processes are waiting for some event that will happen by the other processes in the set, this kind of condition is called deadlock. Deadlock is a situation when two or more processes get locked and can not be processed further because of interdependently. •Deadlock is situation where set of processes are blocked because each process is holding a resource and waiting for another resource acquired by some other process. •Deadlock may include the same resource shared by the processes, or may be different resources shared. In the normal case, a process utilises the resources in the sequence of Request, Use and Release. •Request : The process first requests the resource. If the request cannot be granted immediately satisfied, it has to wait until the requested resource is available. •Use : The process can operate on the resource.(e.g. If the resource is printer, the process can print on printer resource) •Release : The process releases the resource. •The request and release of resources are system calls provided by operating system. E.g. system calls are request() and release() device, open() and close() files, allocate() and free() memory. •Request and Release system call can be accomplished through wait() and signal() operations on semaphores. Semaphores are special variables that allow controlling the access to the common resources in multi-programming environment. •Semaphore is an integer variable that solves the critical section problem(deadlock). After initialisation, it can only be accessed by two atomic operations named wait() and signal(). There are two types of semaphores a) Binary semaphore b) Counting semaphore. Necessary Conditions for deadlock : Following four conditions that must hold for there to be deadlock. i.e. There are 4 conditions necessary for the occurrence of a deadlock. 1. Mutual Exclusion : At least one resource is held in a non-sharable mode that is only one process at a time can use the resource. If another process requests that resource, the requesting process must be delayed until the resource has been released. 2. Hold and Wait: There must be at least one resource that is holding at least one resource waiting for getting other resources that are currently held by other processes. 3. No preemption: Resources granted to requesting process can not be taken away by compelling it. These resources should be released by the process itself that is holding it. 4. Circular wait: There should be a collection or a set of processes like(P0,P1.P2…Pn). In this set of process P0 is waiting for resource that is being utlised by P1. Also P1 is waiting for the resource that is being used by P2 and so on. Thus , 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.