Abstract:
Nowadays concurrent programming is in large demand. The inherent support for concurrency is therefore increasingly important in programming languages. As for C++, an abun...Show MoreMetadata
Abstract:
Nowadays concurrent programming is in large demand. The inherent support for concurrency is therefore increasingly important in programming languages. As for C++, an abundance of standard concurrency constructs have been supported since C++11. However, to date there is little work investigating how these constructs are actually used in developing real software. In this paper, we perform an empirical study to investigate the adoption of C++ concurrency constructs in open-source applications, with the goal to provide insightful information for practitioners to use concurrency constructs efficiently. To this end, we analyze 127 open-source applications that adopt C++ concurrency constructs, comprising 34 million lines of C++ code, to conduct the experiment. The experimental results show that: (1) to implement concurrency code, thread-based constructs are significantly more often used than atomics-based constructs and task-based constructs; (2) to manage synchronization, lock-based constructs are significantly more often used than lock-free constructs and blocking constructs; (3) among the key thread-based constructs and task-based constructs (i.e. mutex, promise, and future), there is not a construct significantly more commonly misused than others; (4) small-size applications introduce concurrency constructs more intensively and more quickly than medium-size applications and large-size applications; and (5) an increasing use of standard concurrency constructs does not result in a substantially decreasing use of unstandardized concurrency constructs. Based on these findings, we make actionable suggestions for language designers, developers, and novices to assist them in designing and using C++ concurrency constructs.
Published in: 2015 ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM)
Date of Conference: 22-23 October 2015
Date Added to IEEE Xplore: 09 November 2015
Electronic ISBN:978-1-4673-7899-4