Withdraw
Loading…
Check-then-Act Misuse of Java Concurrent Collections
Lin, Yu; Dig, Danny
Loading…
Permalink
https://hdl.handle.net/2142/34753
Description
- Title
- Check-then-Act Misuse of Java Concurrent Collections
- Author(s)
- Lin, Yu
- Dig, Danny
- Issue Date
- 2012
- Keyword(s)
- Check-then-Act
- Java concurrent collection
- Atomicity violation
- Abstract
- Concurrent collections provide thread-safe, highly-scalable operations, and are widely used in practice. However, programmers can misuse these concurrent collections by composing one operation that checks a condition (e.g., whether the collection contains an element) with another operation that acts based on this condition (e.g., insert the element into the collection). Unless the whole composition is atomic, the program contains an atomicity violation bug. In this paper we present the first empirical study of CHECK-THEN-ACT idioms of Java concurrent collections in a large corpus of open-source applications. We catalog nine commonly misused check-then-act idioms and show the correct usage. We quantitatively and qualitatively analyze 28 widely-used open source Java projects that use Java concurrency collections – comprising 6.4M lines of code. We classify the commonly used idioms, the ones that are the most error-prone, and the evolution of the programs with respect to misused idioms. We found 282 buggy instances. We reported 155 to the developers, who examined 90 of them. The developers confirmed 60 as new bugs and accepted our patch. This shows that CHECK-THENACT idioms are commonly misused in practice, and correcting them is important.
- Type of Resource
- text
- Language
- en
- Permalink
- http://hdl.handle.net/2142/34753
Owning Collections
Manage Files
Loading…
Edit Collection Membership
Loading…
Edit Metadata
Loading…
Edit Properties
Loading…
Embargoes
Loading…