skip to main content
research-article

Views: Synthesizing fine-grained concurrency control

Published:04 March 2013Publication History
Skip Abstract Section

Abstract

Fine-grained locking is often necessary to increase concurrency. Correctly implementing fine-grained locking with today's concurrency primitives can be challenging—race conditions often plague programs with sophisticated locking schemes.

We present views, a new approach to concurrency control. Views ease the task of implementing sophisticated locking schemes and provide static checks to automatically detect many data races. A view of an object declares a partial interface, consisting of fields and methods, to the object that the view protects. A view also contains an incompatibility declaration, which lists views that may not be simultaneously held by other threads. A set of view annotations specify which code regions hold a view of an object. Our view compiler performs simple static checks that identify many data races. We pair the basic approach with an inference algorithm that can infer view incompatibility specifications for many applications.

We have ported four benchmark applications to use views: portions of Vuze, a BitTorrent client; Mailpuccino, a graphical email client; jphonelite, a VoIP softphone implementation; and TupleSoup, a database. Our experience indicates that views are easy to use, make implementing sophisticated locking schemes simple, and can help eliminate concurrency bugs. We have evaluated the performance of a view implementation of a red-black tree and found that views can significantly improve performance over that of the lock-based implementation.

Skip Supplemental Material Section

Supplemental Material

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. Bacon, D. F., Strom, R. E., and Tarafdar, A. 2000. Guava: A dialect of Java without data races. In Proceedings of the International Conference on Object-Oriented Programming, Systems, Languages, and Applications. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Blanchet, B. 1999. Escape analysis for object-oriented languages: application to Java. In Proceedings of the 14th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications. 20--34. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Boyapati, C., Lee, R., and Rinard, M. 2002. Ownership types for safe programming: Preventing data races and deadlocks. InProceedings of the ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Boyapati, C. and Rinard, M. 2001. A parameterized type system for race-free Java programs. In Proceedings of the ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Buhr, P. A. and Harji, A. S. 2005. Concurrent urban legends. Concur. Comput. Pract. Exper. 17, 9, 1133--1172. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Cherem, S., Chilimbi, T., and Gulwani, S. 2008. Inferring locks for atomic sections. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. 304--315. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Choi, J., Lee, K., Loginov, A., O'Callahan, R., Sarkar, V., and Sridharan, M. 2002. Efficient and precise datarace detection for multithreaded object-oriented programs. In Proceedings of the ACM Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Demsky, B. and Lam, P. 2010. Views: Object-inspired concurrency control. In Proceedings of the International Conference on Software Engineering. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Emmi, M., Fischery, J. S., Jhala, R., and Majumdar, R. 2007. Lock allocation. In Proceedings of the 34th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Engler, D. and Ashcraft, K. 2003. RacerX: Effective, static detection of race conditions and deadlocks. In Proceedings of the 19th ACM Symposium on Operating Systems Principles. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Flatt, M., Krishnamurthi, S., and Felleisen, M. 1998. Classes and mixins. In Proceedings of the 25th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '98). ACM, New York, NY, 171--183. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Greenhouse, A. 2003. A programmer-oriented approach to safe concurrency. Ph.D. thesis, Carnegie Mellon University, Pittsburgh, PA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Halpert, R. L., Pickett, C. J., and Verbrugge, C. 2007. Component-based lock allocation. In Proceedings of the 16th International Conference on Parallel Architecture and Compilation Techniques. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Harris, T., Larus, J., and Rajwar, R. 2010. Transactional Memory, 2 ed. Vol. 5. Morgan and Claypool Publishers. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Hicks, M., Foster, J. S., and Pratikakis, P. 2006. Lock inference for atomic sections. In Proceedings of the 1st ACM SIGPLAN Workshop on Languages, Compilers, and Hardware Support for Transactional Computing.Google ScholarGoogle Scholar
  17. Korty, J. A. 1989. Sema: A lint-like tool for analyzing semaphore usage in a multithreaded UNIX kernel. In Proceedings of the USENIX Winter Technical Conference.Google ScholarGoogle Scholar
  18. Kulkarni, M., Nguyen, D., Prountzos, D., Sui, X., and Pingali, K. 2011. Exploiting the commutativity lattice. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Lev, Y., Luchangco, V., and Olszewski, M. 2009. Scalable reader-writer locks. In Proceedings of the 21st Annual Symposium on Parallelism in Algorithms and Architectures. ACM, New York, NY, 101--110. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Marino, D., Musuvathi, M., and Narayanasamy, S. 2009. LiteRace: Effective sampling for lightweight data-race detection. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Naik, M. 2008. Effective static race detection for Java. Ph.D. thesis, Stanford University. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Naik, M. and Aiken, A. 2007. Conditional must not aliasing for static race detection. In Proceedings of the ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. 327--338. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Naik, M., Aiken, A., and Whaley, J. 2006. Effective static race detection for Java. In Proceedings of the ACM SIGPLAN conference on Programming Language Design and Implementation. 308--319. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Nystrom, N., Clarkson, M. R., and Myers, A. C. 2003. Polyglot: An extensible compiler framework for Java. In Proceedings of the 12th International Conference on Compiler Construction. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Orlin, J. 1977. Contentment in graph theory: Covering graphs with cliques. Indagationes Mathematicae 80, 5, 406--424.Google ScholarGoogle ScholarCross RefCross Ref
  26. Savage, S., Burrows, M., Nelson, G., Sobalvarro, P., and Anderson, T. 1997. Eraser: A dynamic data race detector for multi-threaded programs. In Proceedings of the Symposium on Operating Systems Principles. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Sterling, N. 1993. Warlock: A static data race analysis tool. In Proceedings of the USENIX Winter Technical Conference.Google ScholarGoogle Scholar
  28. Sutherland, D. F. and Scherlis, W. L. 2010. Composable thread coloring. In Proceedings of the ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP '10). 233--244. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Vaziri, M., Tip, F., and Dolby, J. 2006. Associating synchronization constraints with data in an object-oriented language. In Proceedings of the 33rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Vaziri, M., Tip, F., Dolby, J., Hammer, C., and Vitek, J. 2010. A type system for data-centric synchronization. In Proceedings of the 24th European Conference on Object-Oriented Programming. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Von Praun, C. and Gross, T. 2001. Object-race detection. In Proceedings of the International Conference on Object-Oriented Programming, Systems, Languages, and Applications. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Yeung, D. and Agarwal, A. 1993. Experience with fine-grain synchronization in MIMD machines for preconditioned conjugate gradient. In Proceedings of the 4th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming. 187--197. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Zhang, Y., Sreedhar, V. C., Zhu, W., Sarkar, V., and Gao, G. R. 2007. Minimum lock assignment: A method for exploiting concurrency among critical sections. InProceedings of the International Workshop on Languages and Compilers for Parallel Computing.Google ScholarGoogle Scholar

Index Terms

  1. Views: Synthesizing fine-grained concurrency control

            Recommendations

            Comments

            Login options

            Check if you have access through your login credentials or your institution to get full access on this article.

            Sign in

            Full Access

            • Published in

              cover image ACM Transactions on Software Engineering and Methodology
              ACM Transactions on Software Engineering and Methodology  Volume 22, Issue 1
              February 2013
              229 pages
              ISSN:1049-331X
              EISSN:1557-7392
              DOI:10.1145/2430536
              Issue’s Table of Contents

              Copyright © 2013 ACM

              Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

              Publisher

              Association for Computing Machinery

              New York, NY, United States

              Publication History

              • Published: 4 March 2013
              • Accepted: 1 September 2011
              • Revised: 1 April 2011
              • Received: 1 June 2010
              Published in tosem Volume 22, Issue 1

              Permissions

              Request permissions about this article.

              Request Permissions

              Check for updates

              Qualifiers

              • research-article
              • Research
              • Refereed

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader