Need a perfect paper? Place your first order and save 5% with this code:   SAVE5NOW

Deadlock Prevention, Avoidance and Recovery

Abstract

Several studies are devoted to solving the deadlock issue, especially in operating systems. Deadlock is a frequent issue that limits the system’s performance and often happens when many processes vie for the same shareable resources. Deadlocked activities wait for an event before running, whereas another method can force them to transition to the ready state. Mutual exclusion, hold and wait for preemption, and circular wait are prerequisites for deadlock. Deadlocks may be handled using four methods: ignorance, detection, avoidance, and prevention. While some academics consider Deadlock Avoidance (DA) less constrictive, Deadlock Prevention (DP) is a simple real-time solution. In Deadlock Prevention, the goal is to set up a system with no chance of a stalemate developing. This essay provides an overview of the literature on methods for resolving operating system deadlock issues. The internal architectural approaches of the chosen solution methods for Deadlock Prevention were examined following a set of criteria for task relevance. Several techniques are used in our study to solve the Deadlock Prevention problem. Methods to address deadlocks have been categorized with the primary purpose of the approaches taken into account. The appropriateness of various operating system deadlock issue resolution strategies is discussed.

Introduction

The phenomenon of deadlock has been the subject of much research in several subfields of computer science, particularly in the study of operating systems. When many operations are deadlocked, they can only execute once they all get the event that will trigger them to transition out of waiting mode and into the ready state. According to another meaning, a process is deadlocked if it waits for an event that will never occur (Gimbert et al., 2022). At this stage, the operating system is responsible for managing the distribution of essential resources like code and data. The term “reentrant” describes software that cannot be modified while operating. Serially reusable code is modifiable but must be reinitialized before being used again.

In contrast to serially reusable code, which a single process can only use at a time, several processes may use reentrant code at once. In the event of a shared resource being called, it is important to specify whether or not all of the participating processes are allowed to utilize it at once. These latter types are the most common participants in impasses. Mutual exclusion, waiting for, preemption, and a circular wait must occur for a stalemate. All four requirements are required for a deadlock, and their presence is sufficient for it to exist. Research on deadlocks primarily focuses on four subtopics: prevention, avoidance, detection, and recovery. To prevent deadlock, it is necessary to guarantee that none of the four possible circumstances for stalemate ever arise. Recent decades have seen many studies focused on removing deadlocks from the realm of operating systems (Huang et al., 2022). Many approaches to Deadlock Prevention in Operating systems are discussed. In the next part, we will discuss deadlock issues and their context. When and why a stalemate occurs is presented. The final part of this paper proposes ways to deal with deadlocks to resolve these issues. Section 4 of the report focuses on the overall findings and recommendations.

Deadlock Problems

A deadlock occurs when two computer programs that share the same resource successfully prohibit each other from using the resource, resulting in both programs being inoperable (Gimbert et al., 2022). It is common for many processes to compete with one another for a limited amount of shareable resources. If a stalemate occurs, it is necessary to have intervention from a process that is not participating in the deadlock to break the impasse and go on. In other words, a deadlock is a state in which two or more processes wait for another to release a resource, or more than two processes wait for resources in a circular chain. Deadlocks may also occur when more than two processes wait for resources in a circular chain. In the context of operating systems, the term “software lock” or “soft lock” refers to a certain sort of resource that cannot be used by more than one process at the same time.

In addition, a process requires exclusive access to not only one resource but multiple resources when working with any of the numerous computer applications with an interface. Consider the following scenario: two processes must save a scanned document on a compact disc. A permit to utilize the scanner is issued to a process when it has requested and been granted permission. Process B was written differently. Thus, it made a new request for the CD recorder and succeeded in getting it. A request for the CD recorder has been made, but it has been denied since B has already disengaged it. Instead of giving up the CD recorder, B asks for the scanner, which brings a sense of regret. In this instance, the system has prevented both processes from moving forward and will remain in this state indefinitely. A situation like this is referred to as a stalemate.

Deadlock prevention, avoidance and recovery strategies

There are four approaches to dealing with deadlocks: ignorance, discovery, prevention, and avoidance. Ignoring deadlock is the least complicated option. When dealing with deadlocks in a system would be irrational. When a deadlock scenario would not result in a critical condition for a certain application, it is acceptable to disregard the deadlocks. Identifying and breaking deadlocks are the goals of deadlock detection. Methods for avoiding deadlocks during resource requests are identified and implemented based on the occurrence and kind of deadlock. In this context, “Deadlock Prevention” means that one of the four necessary agreements for deadlock cannot occur inside the system. Each approach has advantages and disadvantages and works best in a certain setting.

Huang et al. (2022) address deadlock issues in a resource-allocation system called the G-system. They make it possible to acquire diverse resources and plan varied routes, including machining, assembly, and disassembly. Limiting access to certain resources will help avoid deadlocks. This may restrict the number of administrative hubs to a maximum of the available resources. In addition, a live Petri Net model, in which the system has a set resource capacity, may be built by the right configuration of its idle locations in the initial marking.

Huang et al. (2022) present a two-phase Deadlock Prevention strategy they name H1-policy, in which they avoid doing a complete siphon enumeration of a plant S3PR model. To address the potential presence of dependent siphons in a Petri net model and their actions during Deadlock Prevention, Huang et al. (2022) presents H2-policy for S3PR nets, an enhanced version of the H1-policy which is one of the most recent iterative Deadlock Prevention strategies.

Ugwuanyi et al. (2022) created a liveness-enforcing supervisory synthesizing policy using the idea of regions; they called it the U1 policy. The effectiveness of a nonblocking supervisor or a liveness-enforcing manager may be measured by observing their employees’ permissive conduct. According to the authors, the computational cost of Deadlock Prevention strategies should be minimal to reach the monitors effectively. They suggest X-policy as a Deadlock Prevention strategy for S3PR networks. Using structural analysis, they build on to a supervisor who enforces liveliness with as few more watchdogs as possible while allowing as much freedom of action as possible.

For a subset of Petri Nets, Row et al. (2019) provide a useful Deadlock Prevention strategy called S3PR. In this study, we use vector marking to show how a set of GMEC may be described using the siphon approach. After that, GMEC-based plant monitoring equipment will be installed. The result net has invariant control over all siphons and cannot produce a siphon owing to the increased number of monitors. By including a large number of arcs and monitors, it may also serve as a maximally permissive supervisor. The suggested strategy can perform admirably in an appropriately sized Petri Net system, the size of which is determined by the number of expendable siphons in the system. In addition, the authors provide a lightweight, multi-tasking OS based on a message queue schedule that includes a Deadlock Prevention policy for use in wireless sensor nodes. The authors construct a model of service interactions, then examine the deadlock issue of shared internet resources. Finally, they provide a technique for analyzing and verifying Deadlock Prevention rules utilizing CSP trace semantics (CSP). The CSP technique defines a model that will study the processes of using online services and shared web resources. Solutions that avoid deadlocks may be analyzed, and theoretical backing for their veracity can be provided using CSP’s trace semantics.

Yuan (2023) uses a Divide-and-Conquer strategy to deal with Deadlock Prevention. Computer scientists have recognized the importance of this design schema for extending computationally effective algorithms to deal with Deadlock Prevention issues in the class of generalized Petri Nets for WS3PR. These algorithms propose a significant reduction in structural and computational complexity and are used to enhance systems that are illegally designed to prevent deadlock from occurring. Feng et al. (2019) propose algorithm H2 as a Siphon-based Deadlock Prevention strategy for Petri nets. The authors construct a Deadlock Prevention strategy for a category of Petri nets that strikes a balance between allowing for a wide range of behaviors and being computationally manageable. It may be used to represent a wide range of adaptable production setups. With this premise in mind, we set out to create the best possible Deadlock Prevention mechanisms.

Guo et al. (2019) examine the effects of full-duplex and half-duplex direct memory access implementations on a network on a chip made for massively parallel processor architectures. Their study introduces a Deadlock Prevention strategy that can keep as many state classes as feasible. A controlled net may be guaranteed to be free of deadlocks if this method is used. To provide only two examples, it may be easily extended to other types of temporal Petri nets, such as TS3PMR and TS4R. In the S3PR and synthesis of the net supervisor, they provide a siphon solution strategy to reduce processing costs while using the theory of regions. The need to finish siphon enumeration makes the Deadlock Prevention policy as difficult as exponential.

According to Anand et al. (2019), a novel technique may make traditional lock-based multithreaded applications deadlock-free. As the authors note, by fusing static analysis performed offline with control of execution performed in real-time, deadlocks may be avoided using this approach. In the first step, they build the program’s control flow graph; in the second, they refine and convert that graph into a formal model that captures key elements of the many potential behaviors of the program. In the third step, they use studies from discrete control theory to look for deadlocks in the model. The feedback control logic used in Deadlock Prevention at run time techniques is combined with other discrete control methods. Lock function wrappers are used to access the control logic, delaying the time and effort required to acquire locks and instrument the program for Deadlock Avoidance.

Conclusion

There needs to be more research dedicated to preventing deadlocks in operating systems. Deadlock requires four necessary conditions: mutual exclusion, preemption, wait for, and circular wait. Deadlock prevention handling techniques must contend with OS resource constraints and the need to allocate several CPUs. Ignorance, detection, avoidance, and prevention are ways to break impasse situations. Deadlock detection involves defining and untangling deadlocks since deadlock prevention mechanisms are mostly static in operating systems. It is important to remember that Deadlock Avoidance is a description of methods. These methods attempt to demonstrate that Deadlock Avoidance detects when a deadlock is about to occur in response to a request for a resource and takes corrective action accordingly. In this context, “Deadlock Prevention” means that one of the four necessary agreements for deadlock cannot occur inside the system. Since then, the best Deadlock Prevention strategy has been established: the management theory of regions. As opposed to other solutions, Deadlock Prevention works in real-time. Petri nets provide the basis for the methods used to solve the problems. This generic mathematical method may examine the deadlock issue in allocating system resources. Deadlock Prevention in the system’s resource allocation life cycle is achieved by ignoring all cycles along each possible route while maintaining a network diagram of the whole system. So, the benefits and drawbacks of each solution are tailored to a specific situation.

References

Anand, A. S., Srivastava, A., & Shyamasundar, R. K. (2019). A deadlock‐free lock‐based synchronization for GPUs. Concurrency and Computation: Practice and Experience31(7), e4991.

Feng, Y., Xing, K., Zhou, M., Wang, X., & Liu, H. (2018). Robust deadlock prevention for automated manufacturing systems with unreliable resources using general Petri nets. IEEE Transactions on Systems, Man, and Cybernetics: Systems50(10), 3515-3527.

Gimbert, H., Mascle, C., Muscholl, A., & Walukiewicz, I. (2022). Distributed controller synthesis for deadlock avoidance. arXiv preprint arXiv:2204.12409.

Guo, X., Wang, S., You, D., Li, Z., & Jiang, X. (2019). A siphon-based deadlock prevention strategy for S 3 PR. IEEE Access7, 86863-86873.

Huang, B., Zhou, M., Lu, X. S., & Abusorrah, A. (2022). Scheduling of resource allocation systems with timed Petri nets: A Survey. ACM Computing Surveys.

Row, T. C., Syu, W. M., Pan, Y. L., & Wang, C. C. (2019). One novel and optimal deadlock recovery policy for flexible manufacturing systems using iterative control transitions strategy. Mathematical Problems in Engineering2019, 1-12.

Ugwuanyi, E. E., Iqbal, M., & Dagiuklas, T. (2022). A comparative analysis of deadlock avoidance and prevention algorithms for resource provisioning in intelligent autonomous transport systems over 6G infrastructure. IEEE Transactions on Intelligent Transportation Systems.

Wang, S., Guo, X., Karoui, O., Zhou, M., You, D., & Abusorrah, A. (2022). A Refined Siphon-Based Deadlock Prevention Policy for a Class of Petri Nets. IEEE Transactions on Systems, Man, and Cybernetics: Systems53(1), 191-203.

Yuan, H. (2023). A Divide and Conquer Strategy to Deadlock Prevention in AMS with a Multitype of Resources using Resource Petri Nets. In Journal of Physics: Conference Series (Vol. 2419, No. 1, p. 012053). IOP Publishing.

 

Don't have time to write this essay on your own?
Use our essay writing service and save your time. We guarantee high quality, on-time delivery and 100% confidentiality. All our papers are written from scratch according to your instructions and are plagiarism free.
Place an order

Cite This Work

To export a reference to this article please select a referencing style below:

APA
MLA
Harvard
Vancouver
Chicago
ASA
IEEE
AMA
Copy to clipboard
Copy to clipboard
Copy to clipboard
Copy to clipboard
Copy to clipboard
Copy to clipboard
Copy to clipboard
Copy to clipboard
Need a plagiarism free essay written by an educator?
Order it today

Popular Essay Topics