Annotation-based diagrams for shared-data concurrency (original) (raw)

Lightweight annotations for controlling sharing in concurrent data structures

ACM SIGPLAN Notices, 2009

SharC is a recently developed system for checking data-sharing in multithreaded programs. Programmers specify sharing rules (read-only, protected by a lock, etc.) for individual objects, and the SharC compiler enforces these rules using static and dynamic checks. Violations of these rules indicate unintended data sharing, which is the underlying cause of harmful data-races. Additionally, SharC allows programmers to change the sharing rules for a specific object using a sharing cast , to capture the fact that sharing rules for an object often change during the object's lifetime. SharC was successfully applied to a number of multi-threaded C programs. However, many programs are not readily checkable using SharC because their sharing rules, and changes to sharing rules, effectively apply to whole data structures rather than to individual objects. We have developed a system called Shoal to address this shortcoming. In addition to the sharing rules and sharing cast of SharC, our syst...

A Programmer-Oriented Approach to Safe Concurrency

2003

Assuring and evolving concurrent programs requires understanding the concurrencyrelated design decisions used in their implementation. In Java-style shared-memory programs, these decisions include which state is shared, how access to it is regulated, and the policy that distinguishes desired concurrency from race conditions. Source code often does not reveal these design decisions because they rarely have purely local manifestations in the code, or because they cannot be inferred from code. Many programmers believe it is too difficult to explicate the models in ordinary practice. As a result, this design intent is usually not expressed, and it is therefore generally infeasible to assure that concurrent programs are free of race conditions. This thesis is about a practicable approach to capturing and expressing design intent, and, through the use of annotations and composable static analyses, assuring consistency of code and intent as both evolve. We use case studies from production Java code and a prototype analysis tool to explore the costs and benefits of a new annotationbased approach for expressing design intent. Our annotations express "mechanical" properties that programmers must already be considering, such as lock-state associations, uniqueness of references, and conceptual aggregations of state. Our analyses reveal race conditions in a variety of case study samples which were drawn from library code and production open source projects. We developed a prototype tool that embodies static analysis techniques for assuring consistency between code and models (expressed as code annotations). Our experience with the tool provides some preliminary evidence of the practicability of our approach for ordinary programmers on deadlines. The dominant design consideration for the tool was adherence to the principle of "early gratification"-some assurance can be obtained with minimal or no annotation effort, and additional increments of annotation are rewarded with additional increments of assurance. The novel technical features of this approach include (1) regions as flexible aggregations of state that can cross object boundaries, (2) a region-based object-oriented effects system; (3) analysis to track the association of locks with regions, (4) policy descriptions for allowable method interleavings, and (5) an incremental process for inserting, validating, and exploiting annotations. It's been a longer journey than I originally intended, but I'm finally done with my dissertation. This was not a solitary journey, and I owe thanks to the many people who gave me support along the way. Obviously, I would like to thank my advisor, Bill Scherlis, for his invaluable advice, guidance, encouragement, and enthusiasm. I'd like to thank my co-advisor, Thomas Gross, and the rest of my committee for their time and for the helpful feedback they have provided. My research wasn't performed in a vacuum, and without the research and engineering results of the other members of the Fluid Group, this dissertation would never have been possible. Thank you,

Static Analysis for Understanding Shared Objects in Open Concurrent Java Programs

2010 17th Working Conference on Reverse Engineering, 2010

Concurrent programming with shared memory in an object-oriented language such as Java is notoriously difficult. Therefore, it is important to study new program understanding techniques for concurrent object-oriented languages. This paper studies shared objects in open concurrent Java programs. First, it proposes a classification of shared objects into three categories: central, owned and distributed. Second, it presents a new static analysis that infers central, owned and distributed objects, as well as experiments with the analysis.

Using Eclipse to demonstrate positive static assurance of Java program concurrency design intent

Proceedings of the 2003 OOPSLA workshop on eclipse technology eXchange - eclipse '03, 2003

Assuring and evolving concurrent programs requires understanding the concurrency-related design decisions used in their implementation. Source code often does not reveal these design decisions because they may not have purely local manifestations in the code, or because they cannot be inferred from code. As a result, this design intent is usually not expressed, and it is therefore generally infeasible to assure that concurrent programs are free of race conditions. We describe a prototype Eclipse-based tool developed as part of research toward a practicable approach to capturing and assuring design intent. Through the use of annotations and composable static analyses we can help assure consistency of code and intent as both evolve. The dominant design consideration for the tool is the principle of "early gratification"-some assurance can be obtained with minimal or no annotation effort, and additional increments of annotation or other effort are rewarded with additional increments of assurance. 1 /** @lock BufLock is this protects Instance */ 2 public class BoundedFIFO { 3 /** @aggregate [] into Instance 4

Static analysis of Java multithreaded and distributed applications

Proceedings International Symposium on Software Engineering for Parallel and Distributed Systems, 1998

The Java language enables the development of concurrent and distributed software through the concepts of thread and remote method invocation (RMI). It is known that developing concurrent and distributed software is a challenging task, mainly because of potential concurrency errors such as deadlocks and livelocks. One promising way to help the designer in this task is providing static analysis tools that can detect such errors in the source code, as documented in the rich literature on static analysis of Ada tasking programs. This paper extends the approach followed for Ada tasking programs to the new Java language, providing formal models for the main thread synchronization primitives offered by the language. The formalism used is Promela, the input language of the model checker SPIN, which is based on extended communicating finite state machines and provides an efficient analysis algorithm.

An annotation-based approach for JCSP concurrent programming

Proceedings of the 1st workshop on Modularity in systems software - MISS '11, 2011

The construction of large scale parallel and concurrent applications is one of the greatest challenges faced by software engineers nowadays. Modern programming models for concurrency including libraries implementing high level abstractions such as JCSP lead to tangled and scattered concurrency code. As such, this paper outlines our initial effort on the separate of concurrent (JCSP code) concern from the sequential Java processes. We explore metadata annotations to implement this separation of concerns. A compiler generates AspectJ code used to instrument the JCSP features under the hood. We also present a case study that assesses the benefits of the proposed approach through a metrics suite.

Architecting software concurrency

The Computer Science Journal of Moldova, 2011

Architecting framework proposed in can be used efficiently for developing concurrency-intensive systems only if there exist languages and tools corresponding to the described concepts. In this article there will be presented an approach based on using formalism. Theoretical advantages of formal specification are well known. However, usage of formal specification in practice ascertains some difficulties, thus their current advantages are not widely explored. The main focus of our research is to improve usage of formal method in verification of concurrency. Our vision consists in adapting the pragmatic approach and relaxing formalism, by creating graphical specification language based on events.

Design and Evaluation of a Diagrammatic Notation to Aid in the Understanding of Concurrency Concepts

29th International Conference on Software Engineering (ICSE'07), 2007

It is generally accepted that concurrency can be difficult for students to reason about and to manage. While some studies provide insight into the nature of these difficulties[6], work remains to be done in understanding the aspects of learning about concurrency that are most difficult, and in developing approaches to dealing with this problem. We have conducted instructor interviews and an observational study of students, identified several key difficulties that students encounter, and developed a diagram that we believe will be an aid to understanding and problemsolving. We present the diagram and results of an initial user evaluation.

An annotation-based approach for JCSP concurrent programming: a quantitative study

2011

The construction of large scale parallel and concurrent applications is one of the greatest challenges faced by software engineers nowadays. Modern programming models for concurrency including libraries implementing high level abstractions such as JCSP lead to tangled and scattered concurrency code. As such, this paper outlines our initial effort on the separate of concurrent (JCSP code) concern from the sequential Java processes. We explore metadata annotations to implement this separation of concerns. A compiler generates AspectJ code used to instrument the JCSP features under the hood. We also present a case study that assesses the benefits of the proposed approach through a metrics suite.

Debugging Concurrent Software: A Study Using Multithreaded Sequence Diagrams

2010 IEEE Symposium on Visual Languages and Human-Centric Computing, 2010

Concurrent software is notoriously difficult to debug. We investigate the use of UML sequence diagrams to help developers correctly reason about the potential behaviors of buggy concurrent software. We conducted a controlled experiment that compared internal (i.e., "in the head") and external representations for reasoning about multithreaded software. For external representations, participants created multithreaded sequence diagrams. The results of the experiment demonstrate a strong positive effect associated with using external representations. Participants who drew diagrams were significantly more successful at reasoning about the potential behavior of concurrent software. Moreover, participants who produced diagrams with higher levels of detail and with fewer errors tended to achieve greater levels of success. Additionally, this paper contributes an extension to the UML sequence diagram notation for showing behavior of multithreaded software and formal metrics for assessing the complexity of thread interactions.