DocumentCode :
1902515
Title :
Practical lock/unlock pairing for concurrent programs
Author :
Hyoun Kyu Cho ; Kelly, Tim ; Yin Wang ; Lafortune, Stephane ; Hongwei Liao ; Mahlke, Scott
fYear :
2013
fDate :
23-27 Feb. 2013
Firstpage :
1
Lastpage :
12
Abstract :
In the multicore era, developers face increasing pressure to parallelize their programs. However, building correct and efficient concurrent programs is substantially more difficult than building sequential ones. To address the multicore challenge, numerous tools have been developed to assist multithreaded programmers, including static and dynamic bug detectors, automated bug fixers, and optimization tools. Many of these tools rely on or benefit from the precise identification of critical sections, i.e., sections where the thread of execution holds at least one lock. For languages where critical sections are not lexically scoped, e.g., C/C++, static analysis often fails to pair up lock and unlock calls correctly. In this paper, we propose a practical lock/unlock pairing mechanism that combines static analysis with dynamic instrumentation to identify critical sections in POSIX multithreaded C/C++ programs. Our method first applies a con-servative inter-procedural path-sensitive dataflow analysis to pair up all lock and unlock calls. When the static analysis fails, our method makes assumptions about the pairing using common heuristics. These assumptions are checked at runtime using lightweight instrumentation. Our experiments show that only one out of 891 lock/unlock pairs violates our assumptions at runtime and the instrumentation imposes negligible overhead of 3.34% at most, for large open-source server programs. Overall, our mechanism can pair up 98.2% of all locks including 7.1 % of them paired speculatively.
Keywords :
C++ language; concurrency control; data flow analysis; multi-threading; program debugging; public domain software; POSIX multithreaded C/C++ programs; automated bug fixers; concurrent programs; conservative interprocedural path-sensitive dataflow analysis; dynamic bug detectors; dynamic instrumentation; large open-source server programs; lightweight instrumentation; multithreaded programmers; optimization tools; practical lock-unlock pairing; static analysis; static bug detectors; Algorithm design and analysis; Analytical models; Concurrent computing; Context; Context modeling; Programming; System recovery; Concurrent programs; Critical section; Dynamic monitoring; Program analysis; Static analysis;
fLanguage :
English
Publisher :
ieee
Conference_Titel :
Code Generation and Optimization (CGO), 2013 IEEE/ACM International Symposium on
Conference_Location :
Shenzhen
Print_ISBN :
978-1-4673-5524-7
Type :
conf
DOI :
10.1109/CGO.2013.6494990
Filename :
6494990
Link To Document :
بازگشت