Towards Generating Thread-Safe Classes Automatically

被引:2
|
作者
Wang, Haichi [1 ]
Wang, Zan [1 ]
Sun, Jun [2 ]
Liu, Shuang [1 ]
Sadiq, Ayesha [3 ]
Li, Yuan-Fang [3 ]
机构
[1] Tianjin Univ, Coll Intelligence & Comp, Tianjin, Peoples R China
[2] Singapore Management Univ, Sch Informat Syst, Singapore, Singapore
[3] Monash Univ, Clayton, Vic, Australia
基金
中国国家自然科学基金;
关键词
concurrency; thread safe class; locking policy; CONCURRENCY; EFFICIENT;
D O I
10.1145/3324884.3416625
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
The existing concurrency model for Java (or C) requires programmers to design and implement thread-safe classes by explicitly acquiring locks and releasing locks. Such a model is error-prone and is the reason for many concurrency bugs. While there are alternative models like transactional memory, manually writing locks remains prevalent in practice. In this work, we propose AutoLock, which aims to solve the problem by fully automatically generating threadsafe classes. Given a class which is assumed to be correct with sequential clients, AutoLock automatically generates a thread-safe class which is linearizable, and does it in a way without requiring a specification of the class. AutoLock takes three steps: (1) infer access annotations (i.e., abstract information on how variables are accessed and aliased), (2) synthesize a locking policy based on the access annotations, and (3) consistently implement the locking policy. AutoLock has been evaluated on a set of benchmark programs and the results show that AutoLock generates thread-safe classes effectively and could have prevented existing concurrency bugs.
引用
收藏
页码:943 / 955
页数:13
相关论文
共 50 条
  • [31] StateML+:: From graphical state machine models to thread-safe Ada code
    Alonso, Diego
    Vicente-Chicote, Cristina
    Pastor, Juan A.
    Alvarez, Barbara
    RELIABLE SOFTWARE TECHNOLOGIES - ADA-EUROPE 2008, 2008, 5026 : 158 - 170
  • [32] A Thread-Safe Communication Mechanism for Message-Passing Interface based on MPI Standard
    Gomes Junior, Augusto Mendes
    Kakugawa, Fernando Ryoji
    Bianchini, Calebe de Paula
    Massetto, Francisco Isidro
    JCPC: 2009 JOINT CONFERENCE ON PERVASIVE COMPUTING, 2009, : 173 - +
  • [33] A Highly Efficient, Thread-Safe Software Cache Implementation for Tightly-Coupled Multicore Clusters
    Pinto, Christian
    Benini, Luca
    PROCEEDINGS OF THE 2013 IEEE 24TH INTERNATIONAL CONFERENCE ON APPLICATION-SPECIFIC SYSTEMS, ARCHITECTURES AND PROCESSORS (ASAP 13), 2013, : 281 - 288
  • [34] GALAHAD, a library of thread-safe Fortran 90 packages for large-scale nonlinear optimization
    Gould, NIM
    Orban, D
    Toint, PL
    ACM TRANSACTIONS ON MATHEMATICAL SOFTWARE, 2003, 29 (04): : 353 - 372
  • [35] Towards automatically retrieving discoveries and generating ontologies
    Cosh, Kenneth
    Lecture Notes in Electrical Engineering, 2015, 339 : 615 - 622
  • [36] Towards automatically generating block comments for code snippets
    Huang, Yuan
    Huang, Shaohao
    Chen, Huanchao
    Chen, Xiangping
    Zheng, Zibin
    Luo, Xiapu
    Jia, Nan
    Hu, Xinyu
    Zhou, Xiaocong
    INFORMATION AND SOFTWARE TECHNOLOGY, 2020, 127
  • [37] Towards Automatically Generating a Personalized Code Formatting Mechanism
    Karanikiotis, Thomas
    Chatzidimitriou, Kyriakos C.
    Symeonidis, Andreas L.
    PROCEEDINGS OF THE 16TH INTERNATIONAL CONFERENCE ON SOFTWARE TECHNOLOGIES (ICSOFT), 2021, : 90 - 101
  • [38] Towards Automatically Generating Descriptive Names for Unit Tests
    Zhang, Benwen
    Hill, Emily
    Clause, James
    2016 31ST IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE), 2016, : 625 - 636
  • [39] High-order thread-safe lattice Boltzmann model for high performance computing turbulent flow simulations
    Montessori, Andrea
    La Rocca, Michele
    Amati, Giorgio
    Lauricella, Marco
    Tiribocchi, Adriano
    Succi, Sauro
    PHYSICS OF FLUIDS, 2024, 36 (03)
  • [40] Towards automatically generating meal plan based on genetic algorithm
    Jia, Nan
    Chen, Jie
    Wang, Rongzheng
    Li, Mingliang
    SOFT COMPUTING, 2024, 28 (9-10) : 6893 - 6908