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 条
  • [21] Architectural aspects of a thread-safe graphical component system based on Aos
    Frey, TM
    MODULAR PROGRAMMING LANGUAGES, PROCEEDINGS, 2003, 2789 : 188 - 191
  • [22] Thread-safe lattice Boltzmann for high-performance computing on GPUs
    Montessori, Andrea
    Lauricella, Marco
    Tiribocchi, Adriano
    Durve, Mihir
    La Rocca, Michele
    Amati, Giorgio
    Bonaccorso, Fabio
    Succi, Sauro
    JOURNAL OF COMPUTATIONAL SCIENCE, 2023, 74
  • [23] An Evaluation of Thread-Safe and Contexts-Domains Features in Cray SHMEM
    Namashivayam, Naveen
    Knaak, David
    Cernohous, Bob
    Radcliffe, Nick
    Pagel, Mark
    OPENSHMEM AND RELATED TECHNOLOGIES: ENHANCING OPENSHMEM FOR HYBRID ENVIRONMENTS, 2016, 10007
  • [24] Is This Class Thread-Safe? Inferring Documentation using Graph-Based Learning
    Habib, Andrew
    Pradel, Michael
    PROCEEDINGS OF THE 2018 33RD IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMTED SOFTWARE ENGINEERING (ASE' 18), 2018, : 41 - 52
  • [25] A Comprehensive Study on the Energy Efficiency of Java']Java's Thread-Safe Collections
    Pinto, Gustavo
    Liu, Kenan
    Castor, Fernando
    Liu, Yu David
    32ND IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2016), 2016, : 20 - 31
  • [26] Enhancing Call-Level Interfaces with Thread-Safe Local Memory Structures
    Pereira, Oscar Mortagua
    Aguiar, Rui L.
    INTERNATIONAL JOURNAL OF SOFTWARE ENGINEERING AND KNOWLEDGE ENGINEERING, 2017, 27 (9-10) : 1549 - 1565
  • [27] Memory-efficient and thread-safe quasi-destructive graph unification
    van Lohuizen, MP
    38TH ANNUAL MEETING OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS, PROCEEDINGS OF THE CONFERENCE, 2000, : 352 - 359
  • [28] Artifacts for "A Comprehensive Study on the Energy Efficiency of Java']Java's Thread-Safe Collections"
    Pinto, Gustavo
    Liu, Kenan
    Castor, Fernando
    Liu, Yu David
    32ND IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2016), 2016, : 614 - 614
  • [29] Address Scaling: Architectural Support for Fine-Grained Thread-Safe Metadata Management
    Mishra, Deepanjali
    Kanellopoulos, Konstantinos
    Panwar, Ashish
    Sriraman, Akshitha
    Seshadri, Vivek
    Mutlu, Onur
    Mowry, Todd C.
    IEEE COMPUTER ARCHITECTURE LETTERS, 2024, 23 (01) : 69 - 72
  • [30] Artifacts for "A Comprehensive Study on the Energy Efficiency of Java']Java's Thread-Safe Collections"
    Pinto, Gustavo
    Liu, Kenan
    Castor, Fernando
    Liu, Yu David
    32ND IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2016), 2016, : 615 - 615