Automatic fine-grained locking generation for shared data structures

Correct mutual-exclusion is one of the key challenges in concurrent programming. Although the fine-grained locking schema can be more efficient compared with the coarse-grained techniques, it is tough to use, as well as error-prone. Here we present a static approach, based on program analysis, to automatically add fine-grained locking primitives to data structures implemented as classes. For tree-like structures, the modified class definitions are guaranteed to be thread-safe. Experiments show that the approach can successfully deal with programs which are challenging to be handled manually, and it works efficiently.

[1]  Rupak Majumdar,et al.  Lock allocation , 2007, POPL '07.

[2]  Guy L. Steele,et al.  The Java Language Specification, Java SE 8 Edition , 2013 .

[3]  Timothy L. Harris,et al.  Lock Inference in the Presence of Large Libraries , 2012, ECOOP.

[4]  Eran Yahav,et al.  Automatic fine-grain locking using shape properties , 2011, OOPSLA '11.

[5]  Martin C. Rinard,et al.  ACM Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA), November 2002 Ownership Types for Safe Programming: Preventing Data Races and Deadlocks , 2022 .

[6]  Vineet Kahlon Automatic lock insertion in concurrent programs , 2012, 2012 Formal Methods in Computer-Aided Design (FMCAD).

[7]  Ke Zhang,et al.  Automatic Annotating and Checking of Dynamic Ownership , 2016, SBLP.

[8]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools (2nd Edition) , 2006 .

[9]  Rupesh Nasre,et al.  DomLock: A New Multi-Granularity Locking Technique for Hierarchies , 2017, ACM Trans. Parallel Comput..

[10]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[11]  G. Ramalingam,et al.  The undecidability of aliasing , 1994, TOPL.

[12]  William Landi,et al.  Interprocedural aliasing in the presence of pointers , 1992 .

[13]  Jeffrey S. Foster,et al.  Lock Inference for Atomic Sections , 2006 .

[14]  Laurie Hendren,et al.  Soot: a Java bytecode optimization framework , 2010, CASCON.

[15]  Charles Zhang,et al.  Unleashing concurrency for irregular data structures , 2014, ICSE.

[16]  Vineet Kahlon,et al.  Reasoning About Threads Communicating via Locks , 2005, CAV.

[17]  David Gay,et al.  Autolocker: synchronization inference for atomic sections , 2006, POPL '06.

[18]  Sumit Gulwani,et al.  Inferring locks for atomic sections , 2008, PLDI '08.

[19]  John K. Ousterhout,et al.  Why Threads Are A Bad Idea , 2013 .

[20]  Irving L. Traiger,et al.  The notions of consistency and predicate locks in a database system , 1976, CACM.