C/C++ Thread Safety Analysis

DeLesley Hutchins, Aaron Ballman, Dean SutherlandSCAM 2014 · OpenReview

Abstract

Writing multithreaded programs is hard. Static analysis tools can help developers by allowing threading policies to be formally specified and mechanically checked. They essentially provide a static type system for threads, and can detect potential race conditions and deadlocks. This paper describes Clang Thread Safety Analysis, a tool which uses annotations to declare and enforce thread safety policies in C and C++ programs. Clang is a production-quality C++ compiler which is available on most platforms, and the analysis can be enabled for any build with a simple warning flag: -Wthread-safety. The analysis is deployed on a large scale at Google, where it has provided sufficient value in practice to drive widespread voluntary adoption. Contrary to popular belief, the need for annotations has not been a liability, and even confers some benefits with respect to software evolution and maintenance.
BibTeX
@inproceedings{hutchins2014c,
  author = {DeLesley Hutchins and Aaron Ballman and Dean Sutherland},
  title = {{C/C++ Thread Safety Analysis}},
  booktitle = {SCAM},
  year = {2014},
  url = {https://openreview.net/forum?id=cTizEk0i39},
}

Loading related content...

Figure