A Type System for Data-Centric Synchronization

  • Mandana Vaziri
  • Frank Tip
  • Julian Dolby
  • Christian Hammer
  • Jan Vitek
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6183)

Abstract

Data-centric synchronization groups fields of objects into atomic sets to indicate they must be updated atomically. Each atomic set has associated units of work, code fragments that preserve the consistency of that atomic set. We present a type system for data-centric synchronization that enables separate compilation and supports atomic sets that span multiple objects, thus allowing recursive data structures to be updated atomically. The type system supports full encapsulation for more efficient code generation. We evaluate our proposal using AJ, which extends the Java programming language with data-centric synchronization. We report on the implementation of a compiler and on refactoring classes from standard libraries and a multi-threaded benchmark to use atomic sets. Our results suggest that data-centric synchronization enjoys low annotation overhead while preventing high-level data races.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Abadi, M., Flanagan, C., Freund, S.N.: Types for safe locking: Static race detection for Java. ACM Transactions on Programming Languages and Systems 28(2) (2006)Google Scholar
  2. 2.
    Boyapati, C., Lee, R., Rinard, M.: Ownership types for safe programming: Preventing data races and deadlocks. In: Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA) (November 2002)Google Scholar
  3. 3.
    Boyapati, C., Rinard, M.: A parameterized type system for race-free Java programs. In: Conference on Object-Oriented Programming Systems, Languages and Applications OOPSLA (2001)Google Scholar
  4. 4.
    Ceze, L., von Praun, C., Cascaval, C., Montesinos, P., Torrellas, J.: Concurrency control with data coloring. In: Workshop on Memory Systems Performance and Correctness (MSPC), pp. 6–10 (2008)Google Scholar
  5. 5.
    Cherem, S., Chilimbi, T., Gulwani, S.: Inferring locks for atomic sections. In: Conference on Programming Language Design and Implementation, PLDI (2008)Google Scholar
  6. 6.
    Clarke, D., Potter, J., Noble, J.: Ownership types for flexible alias protection. In: Conference on Object-Oriented Programming, Languages, and Applications, OOPSLA (1998)Google Scholar
  7. 7.
    Flanagan, C., Qadeer, S.: A type and effect system for atomicity. In: Conference on Programming Language Design and Implementation, PLDI (2003)Google Scholar
  8. 8.
    Flanagan, C., Freund, S.: Type-based race detection for Java. In: Conference on Programming Language Design and Implementation, PLDI (June 2000)Google Scholar
  9. 9.
    Flanagan, C., Freund, S.N., Lifshin, M., Qadeer, S.: Types for atomicity: Static checking and inference for Java. ACM Transactions on Programming Languages and Systems 30(4) (2008)Google Scholar
  10. 10.
    Greenhouse, A., Boyland, J.: An object-oriented effects system. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, vol. 1628, p. 205. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  11. 11.
    Grothoff, C., Palsberg, J., Vitek, J.: Encapsulating objects with confined types. Transactions on Programming Languages and Systems 29(6), 32–73 (2007)CrossRefGoogle Scholar
  12. 12.
    Hammer, C., Dolby, J., Vaziri, M., Tip, F.: Dynamic detection of atomic-set-serializability violations. In: International Conference on Software Engineering, ICSE (2008)Google Scholar
  13. 13.
    Harris, T., Fraser, K.: Language support for lightweight transactions. In: Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA), pp. 388–402 (November 2003)Google Scholar
  14. 14.
    Herlihy, M., Moss, J.E.B.: Transactional Memory: Architectural Support for Lock-Free Data Structures. In: International Symposium on Computer Architecture, ISCA (1993)Google Scholar
  15. 15.
    Hoare, C.A.R.: Monitors: an operating system structuring concept. Communications of the ACM 17(10), 549–557 (1974)MATHCrossRefGoogle Scholar
  16. 16.
    Igarashi, A., Pierce, B.C., Wadler, P.: Featherweight Java: a minimal core calculus for Java and GJ. ACM Transactions on Programming Languages and Systems 23(3), 396–450 (2001)CrossRefGoogle Scholar
  17. 17.
    Kidd, N., Reps, T.W., Dolby, J., Vaziri, M.: Finding concurrency-related bugs using random isolation. In: Jones, N.D., Müller-Olm, M. (eds.) VMCAI 2009. LNCS, vol. 5403, pp. 198–213. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  18. 18.
    Rustan, K., Leino, M.: Data Groups: Specifying the modification of extended state. In: Conference on Object-Oriented Programming Systems, Languages and Applications, OOPSLA (1998)Google Scholar
  19. 19.
    McCloskey, B., Zhou, F., Gay, D., Brewer, E.: Autolocker: Synchronization inference for atomic sections. In: Symposium on Principles of Programming Languages, POPL (2006)Google Scholar
  20. 20.
    Noble, J., Potter, J., Vitek, J.: Flexible alias protection. In: Jul, E. (ed.) ECOOP 1998. LNCS, vol. 1445, p. 158. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  21. 21.
    Vaziri, M., Tip, F., Dolby, J.: Associating synchronization constraints with data in an object-oriented language. In: Symposium on Principles of Programming Languages, POPL (2006)Google Scholar
  22. 22.
    Vitek, J., Bokowski, B.: Confined types in Java. Software Practice & Experience 31(6), 507–532 (2001)MATHCrossRefGoogle Scholar
  23. 23.
    Wang, L., Stoller, S.D.: Accurate and efficient runtime detection of atomicity errors in concurrent programs. In: Symposium on Principles and Practice of Parallel Programming, PPoPP (2006)Google Scholar
  24. 24.
    Wang, L., Stoller, S.D.: Runtime analysis of atomicity for multithreaded programs. IEEE Transactions on Software Engineering 32(2) (2006)Google Scholar
  25. 25.
    Wrigstad, T., Pizlo, F., Meawad, F., Zhao, L., Vitek, J.: Loci: Simple thread-locality for Java. In: Drossopoulou, S. (ed.) ECOOP 2009 – Object-Oriented Programming. LNCS, vol. 5653, pp. 445–469. Springer, Heidelberg (2009)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  • Mandana Vaziri
    • 2
  • Frank Tip
    • 2
  • Julian Dolby
    • 2
  • Christian Hammer
    • 1
  • Jan Vitek
    • 1
    • 2
  1. 1.Computer Science Dept.Purdue University 
  2. 2.IBM T.J. Watson Research Center 

Personalised recommendations