DocumentCode
175501
Title
C/C++ Thread Safety Analysis
Author
Hutchins, DeLesley ; Ballman, Aaron ; Sutherland, Dean
fYear
2014
fDate
28-29 Sept. 2014
Firstpage
41
Lastpage
46
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.
Keywords
C++ language; multi-threading; program diagnostics; software maintenance; software quality; C-C++ thread safety analysis; Clang thread safety analysis; Google; Wthread-safety; deadlocks; multithreaded programs; production-quality C++ compiler; race conditions; software evolution; software maintenance; static analysis tools; static type system; threading policies; Documentation; Google; Instruction sets; Message systems; Safety; Semantics; System recovery; C++; calculus of capabilities; deadlock; linear logic; race conditions; static analysis; thread roles; thread safety; type systems;
fLanguage
English
Publisher
ieee
Conference_Titel
Source Code Analysis and Manipulation (SCAM), 2014 IEEE 14th International Working Conference on
Conference_Location
Victoria, BC
Type
conf
DOI
10.1109/SCAM.2014.34
Filename
6975634
Link To Document