Abstract
Concurrency-related errors, such as data races, are frustratingly difficult to track down and eliminate in large object-oriented programs. Traditional approaches to preventing data races rely on protecting instruction sequences with synchronization operations. Such control-centric approaches are inherently brittle, as the burden is on the programmer to ensure that all concurrently accessed memory locations are consistently protected. Data-centric synchronization is an alternative approach that offloads some of the work on the language implementation. Data-centric synchronization groups fields of objects into atomic sets to indicate that these fields must always be updated atomically. Each atomic set has associated units of work, that is, code fragments that preserve the consistency of that atomic set. Synchronization operations are added automatically by the compiler. We present an extension to the Java programming language that integrates annotations for data-centric concurrency control. The resulting language, called AJ, relies on a type system that enables separate compilation and supports atomic sets that span multiple objects and that also supports full encapsulation for more efficient code generation. We evaluate our proposal by refactoring classes from standard libraries, as well as a number of multithreaded benchmarks, to use atomic sets. Our results suggest that data-centric synchronization is easy to use and enjoys low annotation overhead, while successfully preventing data races. Moreover, experiments on the SPECjbb benchmark suggest that acceptable performance can be achieved with a modest amount of tuning.
- Abadi, M., Flanagan, C., and Freund, S. N. 2006. Types for safe locking: Static race detection for Java. ACM Trans. Program. Lang. Syst. 28, 2, 207--255. Google ScholarDigital Library
- Artho, C., Havelund, K., and Biere, A. 2003. High-level data races. Softw. Test. Verification Reliab. 13, 4, 207--227.Google ScholarCross Ref
- Bergan, T., Anderson, O., Devietti, J., Ceze, L., and Grossman, D. 2010. Coredet: A compiler and runtime system for deterministic multithreaded execution. In Proceedings of the Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS). 53--64. Google ScholarDigital Library
- Bocchino, R., Adve, V., Dig, D., Adve, S., Heumann, S., Komuravelli, R., Overbey, J., Simmons, P., Sung, H., and Vakilian, M. 2009. A type and effect system for deterministic parallel Java. In Proceedigs of the Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA). 97--116. Google ScholarDigital Library
- Boyapati, C., Lee, R., and Rinard, M. 2002. Ownership types for safe programming: Preventing data races and deadlocks. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA). 211--230. Google ScholarDigital Library
- Boyapati, C. and Rinard, M. 2001. A parameterized type system for race-free Java programs. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA). 56--69. Google ScholarDigital Library
- Burrows, M. and Leino, K. R. M. 2004. Finding stale-value errors in concurrent programs. Concurrency Pract. Exper. 16, 12, 1161--1172. Google ScholarDigital Library
- Ceze, L., von Praun, C., Cascaval, C., Montesinos, P., and Torrellas, J. 2008. Concurrency control with data coloring. In Proceedings of the Workshop on Memory Systems Performance and Correctness (MSPC). 6--10. Google ScholarDigital Library
- Cherem, S., Chilimbi, T., and Gulwani, S. 2008. Inferring locks for atomic sections. In Proceedings of the Conference on Programming Language Design and Implementation (PLDI). 304--315. Google ScholarDigital Library
- Clarke, D., Potter, J., and Noble, J. 1998. Ownership types for flexible alias protection. In Proceedings of the Conference on Object-Oriented Programming Languages, and Applications (OOPSLA). 48--64. Google ScholarDigital Library
- Demsky, B. and Lam, P. 2010. Views: Object-inspired concurrency control. In Proceedings of the International Conference on Software Engineering. 395--404. Google ScholarDigital Library
- Deng, X., Dwyer, M. B., Hatcliff, J., and Mizuno, M. 2002. Invariant-based specification, synthesis, and verification of synchronization in concurrent programs. In Proceedings of the International Conference on Software Engineering (ICSE). 442--452. Google ScholarDigital Library
- Engler, D. R. and Ashcraft, K. 2003. RacerX: Effective, static detection of race conditions and deadlocks. In Proceedings of the Symposium on Operating Systems Principles (SOSP). 237--252. Google ScholarDigital Library
- Flanagan, C. and Freund, S. N. 2000. Type-based race detection for Java. In Proceedings of the Conference on Programming Language Design and Implementation (PLDI). 219--232. Google ScholarDigital Library
- Flanagan, C., Freund, S. N., Lifshin, M., and Qadeer, S. 2008. Types for atomicity: Static checking and inference for Java. ACM Trans. Programm. Lang. Syst. 30, 4. Google ScholarDigital Library
- Flanagan, C. and Qadeer, S. 2003. A type and effect system for atomicity. In Proceedings of the Conference on Programming Language Design and Implementation (PLDI). 338--349. Google ScholarDigital Library
- Greenhouse, A. and Boyland, J. 1999. An object-oriented effects system. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP). 205--229. Google ScholarDigital Library
- Grothoff, C., Palsberg, J., and Vitek, J. 2007. Encapsulating objects with confined types. ACM Trans. Program. Lang. Syst. 29, 6, 32--73. Google ScholarDigital Library
- Hammer, C., Dolby, J., Vaziri, M., and Tip, F. 2008. Dynamic detection of atomic-set-serializability violations. In Proceedings of the International Conference on Software Engineering (ICSE). 231--240. Google ScholarDigital Library
- Harris, T. and Fraser, K. 2003. Language support for lightweight transactions. In Proceedings of the Conference on Object-Oriented Programming Systems Languages, and Applications (OOPSLA) (Nov.). 388--402. Google ScholarDigital Library
- Herlihy, M. and Moss, J. E. B. 1993. Transactional memory: Architectural support for lock-free data structures. In Proceedings of the International Symposium on Computer Architecture (ISCA). 289--300. Google ScholarDigital Library
- Hoare, C. A. R. 1974. Monitors: An operating system structuring concept. Comm. ACM 17, 10, 549--557. Google ScholarDigital Library
- Kidd, N., Reps, T., Dolby, J., and Vaziri, M. 2011. Finding concurrency-related bugs using random isolation. Int. J. Softw. Tools Technol. Transfer 13, 495--518. Google ScholarDigital Library
- Kulkarni, A., Liu, Y. D., and Smith, S. F. 2010. Task types for pervasive atomicity. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA). 671--690. Google ScholarDigital Library
- Lai, Z., Cheung, S. C., and Chan, W. K. 2010. Detecting atomic-set serializability violations in multithreaded programs through active randomized testing. In Proceedings of the International Conference on Software Engineering. 235--244. Google ScholarDigital Library
- Leino, K. R. M. 1998. Data Groups: Specifying the modification of extended state. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA). 144--153. Google ScholarDigital Library
- Leino, K. R. M., Saxe, J. B., and Stata, R. 1999. Checking Java programs via guarded commands. In Proceedings of the European Conference on Object-Oriented Programming Workshop Reader. 110--111. Google ScholarDigital Library
- Lu, S., Park, S., Hu, C., Ma, X., Jiang, W., Li, Z., Popa, R. A., and Zhou, Y. 2007. Muvi: Automatically inferring multi-variable access correlations and detecting related semantic and concurrency bugs. In Proceedings of the Symposium on Operating Systems Principles (SOSP). 103--116. Google ScholarDigital Library
- Lu, S., Park, S., Seo, E., and Zhou, Y. 2008. Learning from mistakes: A comprehensive study on real world concurrency bug characteristics. In Proceedings of the Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS). 329--339. Google ScholarDigital Library
- Lucia, B., Ceze, L., and Strauss, K. 2010. Colorsafe: Architectural support for debugging and dynamically avoiding multi-variable atomicity violations. In Proceedings of the International Symposium on Computer Architecture (ISCA'10). 222--233. Google ScholarDigital Library
- McCloskey, B., Zhou, F., Gay, D., and Brewer, E. 2006. Autolocker: Synchronization inference for atomic sections. In Proceedings of the Conference Record of the Symposium on Principles of Programming Languages (POPL). 346--358. Google ScholarDigital Library
- Noble, J., Vitek, J., and Potter, J. 1998. Flexible alias protection. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP). 158--185. Google ScholarDigital Library
- O'Callahan, R. and Choi, J.-D. 2003. Hybrid dynamic data race detection. In Proceedings of the Symposium on Principles and Practice of Parallel Programming (PPoPP). 167--178. Google ScholarDigital Library
- Savage, S., Burrows, M., Nelson, G., Sobalvarro, P., and Anderson, T. E. 1997. Eraser: A dynamic data race detector for multi-threaded programs. In Proceedings of the Symposium on Operating Systems Principles (SOSP). 27--37. Google ScholarDigital Library
- Vaziri, M., Tip, F., and Dolby, J. 2006. Associating synchronization constraints with data in an object-oriented language. In Proceedings of the Conference Record of the Symposium on Principles of Programming Languages (POPL). 334--345. Google ScholarDigital Library
- Vitek, J. and Bokowski, B. 2001. Confined types in Java. Softw. Pract. Exper. 31, 6, 507--532. Google ScholarDigital Library
- von Praun, C. and Gross, T. R. 2004. Static detection of atomicity violations in object-oriented programs. J. Object Technol. 3, 6, 103--122.Google ScholarCross Ref
- Wang, L. and Stoller, S. D. 2006a. Accurate and efficient runtime detection of atomicity errors in concurrent programs. In Proceedings of the Symposium on Principles and Practice of Parallel Programming (PPoPP). 137--146. Google ScholarDigital Library
- Wang, L. and Stoller, S. D. 2006b. Runtime analysis of atomicity for multithreaded programs. IEEE Trans. Softw. Eng. 32, 2, 93--110. Google ScholarDigital Library
- Wrigstad, T., Pizlo, F., Meawad, F., Zhao, L., and Vitek, J. 2009. Loci: Simple thread-locality for Java. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP). 445--469. Google ScholarDigital Library
- Xu, M., Bodik, R., and Hill, M. D. 2005. A serializability violation detector for shared-memory server programs. In Proceedings of the Conference on Programming Language Design and Implementation (PLDI). 1--14. Google ScholarDigital Library
Index Terms
- A data-centric approach to synchronization
Recommendations
Associating synchronization constraints with data in an object-oriented language
Proceedings of the 2006 POPL ConferenceConcurrency-related bugs may happen when multiple threads access shared data and interleave in ways that do not correspond to any sequential execution. Their absence is not guaranteed by the traditional notion of "data race" freedom. We present a new ...
Associating synchronization constraints with data in an object-oriented language
POPL '06: Conference record of the 33rd ACM SIGPLAN-SIGACT symposium on Principles of programming languagesConcurrency-related bugs may happen when multiple threads access shared data and interleave in ways that do not correspond to any sequential execution. Their absence is not guaranteed by the traditional notion of "data race" freedom. We present a new ...
Dynamic detection of atomic-set-serializability violations
ICSE '08: Proceedings of the 30th international conference on Software engineeringPreviously we presented atomic sets, memory locations that share some consistency property, and units of work, code fragments that preserve consistency of atomic sets on which they are declared. We also proposed atomic-set serializability as a ...
Comments