Gadara: Dynamic deadlock avoidance for multithreaded programs (original) (raw)

Dynamic deadlock avoidance in systems code using statically inferred effects

Proceedings of the 6th Workshop on Programming Languages and Operating Systems - PLOS '11, 2011

Deadlocks can have devastating effects in systems code. We have developed a type and effect system that provably avoids them and in this paper we present a tool that uses a sound static analysis to instrument multithreaded C programs and then links these programs with a run-time system that avoids possible deadlocks. In contrast to most other purely static tools for deadlock freedom, our tool does not insist that programs adhere to a strict lock acquisition order or use lock primitives in a block-structured way, thus it is appropriate for systems code and OS applications. We also report some very promising benchmark results which show that all possible deadlocks can automatically be avoided with only a small run-time overhead. More importantly, this is done without having to modify the original source program by altering the order of resource acquisition operations or by adding annotations.

Gadara nets: Modeling and analyzing lock allocation for deadlock avoidance in multithreaded software

2009

Abstract Deadlock avoidance in shared-memory multithreaded programs is receiving increased attention as multicore architectures and parallel programming are becoming more prevalent. In our on-going project, called Gadara, the objective is to control the execution of multithreaded programs in order to avoid deadlocks by using techniques from discrete-event control theory. In this project, Petri nets are employed to model parallel programs.

Maximally permissive deadlock avoidance for multithreaded computer programs (Extended abstract)

2009 IEEE International Conference on Automation Science and Engineering, 2009

Multicore architectures in computer hardware bring an unprecedented need for parallel programming. In the work considered in this presentation, we are especially interested in multithreaded programs with shared data. In this widely- used programming paradigm, "lock" primitives are employed to control access to the shared data within the program threads.In this write-up, we report the progress of an ongoing project,

A Deadlock Prevention Policy for a Class of Multithreaded Software

IEEE Access, 2020

Deadlock is an undesired situation in multithreaded software since it can lead to the stoppage of software. This paper studies the problem of deadlock control of multithreaded software based on Gadara nets, which are well studied for modelling concurrent programs. In particular, an iterative deadlock prevention policy based on siphons is proposed for a class of ordinary Gadara nets where the initial marking of each idle place is one. At each iteration, we compute emptiable siphons containing the smallest number of resource places. Then, bad markings are computed based on these siphons. On the basis of the bad markings, a constraint is constructed that forbids not only bad markings that empty one of the siphons but also some other bad markings. The algorithm is carried out until no emptiable siphon exists in the net. Compared with the existing methods, the resultant net derived from the proposed method is live and maximally permissive with a simpler supervisor. Finally, two examples ...

Maximally permissive deadlock avoidance for multithreaded computer programs

2009

Abstract Multicore architectures in computer hardware bring an unprecedented need for parallel programming. In the work considered in this presentation, we are especially interested in multithreaded programs with shared data. In this widely-used programming paradigm," lock" primitives are employed to control access to the shared data within the program threads.

Detecting Potential Deadlocks with Static Analysis and Run-Time Monitoring

2005

Concurrent programs are notorious for containing errors that are difficult to reproduce and diagnose. A common kind of concurrency error is deadlock, which occurs when a set of threads is blocked each trying to acquire a lock held by another thread in that set. Static and dynamic (run-time) analysis techniques exist to detect deadlocks. Havelund's GoodLock algorithm detects potential deadlocks at run-time. However, it detects only potential deadlocks involving exactly two threads. This paper presents a generalized version of the GoodLock algorithm that detects potential deadlocks involving any number of threads. Run-time checking may miss errors in unexecuted code. On the positive side, runtime checking generally produces fewer false alarms than static analysis. This paper explores the use of static analysis to automatically reduce the overhead of run-time checking. We extend our type system, Extended Parameterized Atomic Java (EPAJ), which ensures absence of races and atomicity violations, with Boyapati et al.'s deadlock types. We give an algorithm that infers deadlock types for a given program and an algorithm that determines, based on the result of type inference, which run-time checks can safely be omitted. The new type system, called Deadlock-Free EPAJ (DEPAJ), has the added benefit of giving stronger atomicity guarantees than previous atomicity type systems.

A transformation to provide deadlock-free programs

2003

A commonly employed technique to control access to shared resources in concurrent programs consists of using critical sections. Unfortunately, it is well known that programs using several critical sections may suffer from deadlocks. In this paper we introduce a new approach for ensuring deadlock-freedom in a transparent manner from the programmer's point of view. Such an approach consists of obtaining a deadlock-free "version" of the original program by using some program transformations. We formally prove the correctness of those transformations and we analyze their applicability.

Scalable Dynamic Deadlock Analysis of Multi-Threaded Programs

This paper presents a dynamic program analysis algorithm that can detect deadlock potentials in a multi-threaded program by ex- amining a single execution trace, obtained by running an instrumented version of the program. The algorithm is interesting because it can iden- tify deadlock potentials even though no deadlocks occur in the examined execution, and therefore it scales very well in contrast to more formal approaches to deadlock detection. It is an improvement of an existing algorithm in that it reduces the number of false positives (false warn- ings). The paper describes an implementation, Java PathExplorer, for analyzing Java programs. An application of the implementation to two case studies is described.

The theory of deadlock avoidance via discrete control

2009

Abstract Deadlock in multithreaded programs is an increasingly important problem as ubiquitous multicore architectures force parallelization upon an ever wider range of software. This paper presents a theoretical foundation for dynamic deadlock avoidance in concurrent programs that employ conventional mutual exclusion and synchronization primitives (eg, multithreaded C/Pthreads programs).

Dynamic Deadlock Analysis of Multi-threaded Programs

Lecture Notes in Computer Science, 2006

This paper presents a dynamic program analysis algorithm that can detect deadlock potentials in a multi-threaded program by examining a single execution trace, obtained by running an instrumented version of the program. The algorithm is interesting because it can identify deadlock potentials even though no deadlocks occur in the examined execution, and therefore it scales very well in contrast to more formal approaches to deadlock detection. It is an improvement of an existing algorithm in that it reduces the number of false positives (false warnings). The paper describes an implementation and an application to three case studies.