ACM Home Page
Please provide us with feedback. Feedback
SharC: checking data sharing strategies for multithreaded c
Full text PdfPdf (211 KB)
Source
Conference on Programming Language Design and Implementation archive
Proceedings of the 2008 ACM SIGPLAN conference on Programming language design and implementation table of contents
Tucson, AZ, USA
SESSION: Session V table of contents
Pages 149-158  
Year of Publication: 2008
ISBN:978-1-59593-860-2
Also published in ...
Authors
Zachary Anderson  University of California, Berkeley, Berkeley, CA, USA
David Gay  Intel, Berkeley, CA, USA
Rob Ennals  Intel, Berkeley, CA, USA
Eric Brewer  University of California, Berkeley, Berkeley, CA, USA
Sponsors
ACM: Association for Computing Machinery
SIGPLAN: ACM Special Interest Group on Programming Languages
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 14,   Downloads (12 Months): 164,   Citation Count: 1
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1375581.1375600
What is a DOI?

ABSTRACT

Unintended or unmediated data sharing is a frequent cause of insidious bugs in multithreaded programs. We present a tool called SharC (short for Sharing Checker) that allows a user to write lightweight annotations to declare how they believe objects are being shared between threads in their program. SharC uses a combination of static and dynamic analyses to check that the program conforms to this specification.

SharC allows any type to have one of five "sharing modes" -- private to the current thread, read-only, shared under the control of a specified lock, intentionally racy, or checked dynamically. The dynamic mode uses run-time checking to verify that objects are either read-only, or only accessed by one thread. This allows us to check programs that would be difficult to check with a purely static system. If the user does not give a type an explicit annotation, then SharC uses a static type-qualifier analysis to infer that it is either private or should be checked dynamically.

SharC allows objects to move between different sharing modes at runtime by using reference counting to check that there are no other references to the objects when they change mode.

SharC's baseline dynamic analysis can check any C program, but is slow, and will generate false warnings about intentional data sharing. As the user adds more annotations, false warnings are reduced, and performance improves.We have found in practice that very few annotations are needed to describe all sharing and give reasonable performance. We ran SharC on 6 legacy C programs, summing to over 600k lines of code, and found that a total of only 60 simple annotations were needed to remove all false positives and to reduce performance overhead to only 2-14%.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

1
 
2
Anderson, Z. R., Gay, D., Ennals, R., and Brewer, E. SharC: Checking data sharing strategies for multithreaded C. Tech. Rep. UCB/EECS-2008-25, EECS Department, University of California, Berkeley, Mar 2008.
3
4
5
 
6
Condit, J., Harren, M., Anderson, Z., Gay, D., and Necula, G. Dependent types for low-level programming. In ESOP?07.
7
8
9
10
 
11
freedesktop.org. Gstreamer: Open source multimedia framework. http://gstreamer.freedesktop.org/.
12
13
 
14
Grossman, D. Type-safe multithreading in Cyclone.
15
16
17
18
19
20
21
22
 
23
Sen, K., and Agha, G. A race-detection and flipping algorithm for automated testing of multi-threaded programs. In Haifa Verification Conference (2006), pp. 166--182.
 
24
US-CERT. Technical cyber security alerts. http://www.us-cert.gov/cas/techalerts/index.html.
25
26


Collaborative Colleagues:
Zachary Anderson: colleagues
David Gay: colleagues
Rob Ennals: colleagues
Eric Brewer: colleagues