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 条
  • [1] Effectiveness and Challenges in Generating Concurrent Tests for Thread-Safe Classes
    Terragni, Valerio
    Pezze, Mauro
    PROCEEDINGS OF THE 2018 33RD IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMTED SOFTWARE ENGINEERING (ASE' 18), 2018, : 64 - 75
  • [2] Efficient Test Case Generation for Thread-Safe Classes
    Bo, Lili
    Jiang, Shujuan
    Qian, Junyan
    Wang, Rongcun
    Wang, Xingya
    IEEE ACCESS, 2019, 7 : 26984 - 26995
  • [3] Teaching Students to Develop Thread-safe Java']Java Classes
    Fekete, Alan D.
    ITICSE '08: PROCEEDINGS OF THE 13TH ANNUAL CONFERENCE ON INNOVATION AND TECHNOLOGY IN COMPUTER SCIENCE EDUCATION, 2008, : 119 - 123
  • [4] Statically driven generation of concurrent tests for thread-safe classes
    Terragni, Valerio
    Pezze, Mauro
    SOFTWARE TESTING VERIFICATION & RELIABILITY, 2021, 31 (04):
  • [5] Thread-safe access to collections
    Kleber, Jeff
    C/C++ Users Journal, 2000, 18 (05): : 38 - 39
  • [6] Thread-Safe Reactive Programming
    Drechsler, Joscha
    Mogk, Ragnar
    Salvaneschi, Guido
    Mezini, Mira
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2018, 2
  • [7] Thread-Safe Reactive Programming
    Drechsler, Joscha
    Mogk, Ragnar
    Salvaneschi, Guido
    Mezini, Mira
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2018, 2
  • [8] Thread-Safe: Towards Recognizing Human Actions Across Shot Boundaries
    Minh Hoai
    Zisserman, Andrew
    COMPUTER VISION - ACCV 2014, PT IV, 2015, 9006 : 222 - 237
  • [9] (Quasi-) thread-safe PVM and (quasi-) thread-safe MPI without active polling
    Plachetka, T
    RECENT ADVANCES IN PARALLEL VITUAL MACHINE AND MESSAGE PASSING INTERFACE, PROCEEDINGS, 2002, 2474 : 296 - 305
  • [10] MAP-Coverage: a Novel Coverage Criterion for Testing Thread-Safe Classes
    Wang, Zan
    Zhao, Yingquan
    Liu, Shuang
    Sun, Jun
    Chen, Xiang
    Lin, Huarui
    34TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE 2019), 2019, : 734 - 746