Towards generating thread-safe classes automatically
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, ma...
Saved in:
Main Authors: | , , , , , |
---|---|
Format: | text |
Language: | English |
Published: |
Institutional Knowledge at Singapore Management University
2020
|
Subjects: | |
Online Access: | https://ink.library.smu.edu.sg/sis_research/5946 https://ink.library.smu.edu.sg/context/sis_research/article/6949/viewcontent/Towards_generating_thread_safe_classes_automatically_pv.pdf |
Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
Institution: | Singapore Management University |
Language: | English |
id |
sg-smu-ink.sis_research-6949 |
---|---|
record_format |
dspace |
spelling |
sg-smu-ink.sis_research-69492021-05-18T03:33:26Z Towards generating thread-safe classes automatically WANG, Haichi WANG, Zan SUN, Jun LIN, Shuang SADIQ, Ayesha LI, Yuan Fang 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 thread-safe 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. 2020-09-01T07:00:00Z text application/pdf https://ink.library.smu.edu.sg/sis_research/5946 info:doi/10.1145/3324884.3416625 https://ink.library.smu.edu.sg/context/sis_research/article/6949/viewcontent/Towards_generating_thread_safe_classes_automatically_pv.pdf http://creativecommons.org/licenses/by-nc-nd/4.0/ Research Collection School Of Computing and Information Systems eng Institutional Knowledge at Singapore Management University concurrency locking policy thread safe class Software Engineering |
institution |
Singapore Management University |
building |
SMU Libraries |
continent |
Asia |
country |
Singapore Singapore |
content_provider |
SMU Libraries |
collection |
InK@SMU |
language |
English |
topic |
concurrency locking policy thread safe class Software Engineering |
spellingShingle |
concurrency locking policy thread safe class Software Engineering WANG, Haichi WANG, Zan SUN, Jun LIN, Shuang SADIQ, Ayesha LI, Yuan Fang Towards generating thread-safe classes automatically |
description |
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 thread-safe 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. |
format |
text |
author |
WANG, Haichi WANG, Zan SUN, Jun LIN, Shuang SADIQ, Ayesha LI, Yuan Fang |
author_facet |
WANG, Haichi WANG, Zan SUN, Jun LIN, Shuang SADIQ, Ayesha LI, Yuan Fang |
author_sort |
WANG, Haichi |
title |
Towards generating thread-safe classes automatically |
title_short |
Towards generating thread-safe classes automatically |
title_full |
Towards generating thread-safe classes automatically |
title_fullStr |
Towards generating thread-safe classes automatically |
title_full_unstemmed |
Towards generating thread-safe classes automatically |
title_sort |
towards generating thread-safe classes automatically |
publisher |
Institutional Knowledge at Singapore Management University |
publishDate |
2020 |
url |
https://ink.library.smu.edu.sg/sis_research/5946 https://ink.library.smu.edu.sg/context/sis_research/article/6949/viewcontent/Towards_generating_thread_safe_classes_automatically_pv.pdf |
_version_ |
1770575701120909312 |