Preview

Deadlocks-Resource Allocation Graph

Good Essays
Open Document
Open Document
1184 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Deadlocks-Resource Allocation Graph
Operating Systems 3 – Deadlocks
Lab notes
Course lectured by Prof. Gabriel Kuper Lab assist. Ilya Zaihrayeu http://www.dit.unitn.it/~ilya/os.htm

Deadlock Prerequisites
Deadlock can arise if four conditions hold simultaneously: Mutual exclusion: only one process at a time can use a resource. If another process requests that resource, the requesting process is delayed until the resource is released; Hold and wait: a process holding at least one resource is waiting to acquire additional resources held by other processes; No preemption: a resource can be released only voluntarily by the process holding it, after that process has completed its task; 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
Ilya Zaihrayeu Operating Systems Course

2

Deadlock Prevention
Mutual Exclusion not required for sharable resources; for non-sharable resources generally not possible to prevent deadlocks by denying the mutual-exclusion condition a possible solution – a spooler Hold and Wait 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 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 Circular Wait impose a total ordering of all resource types, and require that each process requests resources in an increasing order of enumeration
Ilya Zaihrayeu Operating Systems Course

3

Traffic deadlock example
Q: Consider the traffic deadlock represented on the right
(a) Show that the 4 necessary conditions for deadlock indeed hold in this example (b) State a simple rule that will avoid deadlocks in the system

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Nt1310 Unit 1 Study Guide

    • 378 Words
    • 2 Pages

    The simplest type of multithreading occurs when one thread runs until it is blocked by an event that normally would create a ___________…

    • 378 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    En1320 Unit 1 Research Paper 1

    • 27742 Words
    • 111 Pages

    programs is not new, the renewed and increased interest is aided by certain trends in…

    • 27742 Words
    • 111 Pages
    Powerful Essays
  • Good Essays

    One of the key functions of an operating system is the process management. Linux OS system is very dynamic with constantly changing computing needs. These needs tend to be centered on the process. Processes can be either long or short lived, so managing these processes is very important. Linux incorporates a very flexible design which contains a separate unit to take on the process management task. In a Linux operating system processes are created and represented by an allocated task_struct.…

    • 749 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Sharing allows several processes to access the same portion of main memory (Stallings, 2012). When there are a number of processes executing the same program it is beneficial to allow each process to access the same copy of the program rather than have its own separate copy (Stallings, 2012,). The memory management system must therefore…

    • 573 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Nt1310 Unit 3 Os

    • 1341 Words
    • 6 Pages

    +• Synchronization: With multiple active processes having potential access to shared address spaces or shared I/O resources, care must be taken to provide effective synchronization. Synchronization is a facility that enforces mutual exclusion and event…

    • 1341 Words
    • 6 Pages
    Good Essays
  • Good Essays

    SIT322 practice exam

    • 899 Words
    • 4 Pages

    a. 1 b. 2 c. 3 d. More than 3 Page 1 SIT322 Distributed Systems Which of the following statements is FALSE? 5) In a send-and-forget system, the sending application can go on to other work a.…

    • 899 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    Filures Paper

    • 498 Words
    • 2 Pages

    There will be a discussion of four different failures within this paper. The failures are as follows: crash failures, timing failures, network failures, and byzantine failures.…

    • 498 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    IT 600 Module One Lecture

    • 1256 Words
    • 5 Pages

    Since a CPU can run only one process at a time, process management must handle the…

    • 1256 Words
    • 5 Pages
    Better Essays
  • Better Essays

    Block Scheduling

    • 835 Words
    • 4 Pages

    A small debate has always been discussed when talking about block scheduling and traditional class periods. Some people like the longer classes while others prefer the traditional six shorter class periods. Everyone has their own opinions about block scheduling. Block scheduling can be really helpful to high school students in many ways. Although, block scheduling is a longer time spent in one class, it should be mandatory in all high schools rather than traditional class periods.…

    • 835 Words
    • 4 Pages
    Better Essays
  • Good Essays

    8. Is it possible that the instructions within a While statement might never be executed at all? Give an example.…

    • 610 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Real Life Exercise

    • 638 Words
    • 3 Pages

    Give at least two “real life” examples (not related to a computer system environment) of each of these concepts: deadlock, starvation and race. Describe how the deadlocks could be resolved.…

    • 638 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Producer vs Consumer

    • 590 Words
    • 3 Pages

    Laboratory three tasked the student with implementing a classic problem in computer science, namely in synchronization. The “Producer-Consumer” problem or, the “bounded-buffer” problem is extremely important in understanding the fundamentals of multi-process synchronization. The problem uses two processes, a producer and a consumer. These two processes share a common buffer, of a fixed size. It is the job of the producer to churn out data items, piece by piece, into the buffer. And at the same time, the consumer is picking up that data, removing it from the buffer at the same rate – one piece at a time. Part of the problem lies in making sure the producer doesn’t add anything to the buffer if the buffer is full, and the consumer isn’t to take anything from the buffer if it is empty.…

    • 590 Words
    • 3 Pages
    Good Essays
  • Good Essays

    In a distributed system nothing is set in stone or perfect, so there are some issues that can arise, and the issues that arise are the failures that can occur in these distributed systems. The failure that can occur are Fail-Stop, Network Failure, Timing Failure, and Byzantine Failures; each of which I will discuss separately.…

    • 998 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    Block Scheduling

    • 8717 Words
    • 35 Pages

    As administrators and educators have researched ways to use time more productively, major changes have been occurring in high school schedules. Within the context of education reform, one of the attributes of the traditional educational system that has been a focus for systemic change has been the use of time (Trenta & Newman, 2002). In Nichols’ (2005) research, it’s noted that one of the most important concerns expressed in A Nation at Risk report was related to how effectively classroom instruction time was being utilized in America’s schools. Evans, Tokarczyk, Rice & McCray (2002) indicated that this report offered many recommendations for school reform initiatives, including restructuring for more effective use of school time and increased concentration on core academic subjects. According to Lawrence and McPherson (2000), administrators and teachers in America have been criticized regarding the poor use of school time since the 1980’s (p. 178).…

    • 8717 Words
    • 35 Pages
    Powerful Essays
  • Satisfactory Essays

    Operating Systems

    • 1023 Words
    • 5 Pages

    4)The OS frequently relinquishes control and must depend on the processor to allow it to regain control. (True)…

    • 1023 Words
    • 5 Pages
    Satisfactory Essays

Related Topics