The Community for Technology Leaders
2013 IEEE International Conference on Software Maintenance (2013)
Eindhoven Netherlands
Sept. 22, 2013 to Sept. 28, 2013
ISSN: 1063-6773
pp: 100-109
Rui Xin , Sch. of Software, Shanghai Jiao Tong Univ., Shanghai, China
Zhengwei Qi , Sch. of Software, Shanghai Jiao Tong Univ., Shanghai, China
Shiqiu Huang , Sch. of Software, Shanghai Jiao Tong Univ., Shanghai, China
Chengcheng Xiang , Sch. of Software, Shanghai Jiao Tong Univ., Shanghai, China
Yudi Zheng , Univ. of Lugano, Lugano, Switzerland
Yin Wang , Facebook, USA
Haibing Guan , Sch. of Software, Shanghai Jiao Tong Univ., Shanghai, China
ABSTRACT
Nowadays concurrent programs are becoming more and more important with the development of hardware and network technologies. However, it is not easy for programmers to write reliable concurrent programs. Concurrency characteristics such as thread-interleaving make it difficult to debug or maintain concurrent programs. Although there are lots of research work on concurrency such as multi-thread testing tools, concurrent program verification and data race detection, all of them leave open problems. For instance, some are not scalable enough for large real world applications and some may report false warnings. Since locks are widely used to protect shared memory, it is beneficial for both programmers and tool designers in all fields to have a good understanding of common lock usage patterns in real world concurrent programs. This paper reports an empirical study on lock usage in concurrent programs. It is based on our automatic lock analysis tool called LUPA. The study analyzes how lock is used in concurrent programs and how lock usage changes throughout the product environment. In this study, four representative concurrent programs (Apache httpd, Mysql, Aget, Pbzip2) are selected, of which both lock manifestation and lock usage pattern in different versions are studied. This study reveals some interesting findings including but not limited to: (1) about 80.5% of the lock related functions acquire only one lock, (2) simple lock patterns account for 54.5% of all lock usage in real world applications, (3) only 12 out of 527 detected patterns belong to condition lock pattern which may lead to vulnerabilities easily, (4) only 0.65% of the functions are lock related. Additionally, a potential bug caused by problematic locking pattern is found.
INDEX TERMS
Concurrent computing, Programming, Pattern recognition, Testing, Computer bugs, Software, Educational institutions
CITATION

Rui Xin et al., "An Automation-Assisted Empirical Study on Lock Usage for Concurrent Programs," 2013 IEEE International Conference on Software Maintenance(ICSM), Eindhoven Netherlands, 2014, pp. 100-109.
doi:10.1109/ICSM.2013.21
273 ms
(Ver 3.3 (11022016))