Skip to main content

Loci: Simple Thread-Locality for Java

  • Conference paper
Book cover ECOOP 2009 – Object-Oriented Programming (ECOOP 2009)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 5653))

Included in the following conference series:

Abstract

This paper presents a simple type system for thread-local data in Java. Classes and types are annotated to express thread-locality and unintended leaks are detected at compile-time. The system, called Loci, is minimal, modular and compatible with legacy code. The only change to the language is the addition of two new metadata annotations. We implemented Loci as an Eclipse plug-in and used it to evaluate our design on a number of benchmarks. We found that Loci is compatible with how Java programs are written and that the annotation overhead is light thanks to a judicious choice of defaults.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Java theory and practice: Synchronization optimizations in mustang, http://www-128.ibm.com/developerworks/java/library/j-jtp10185/

  2. Aldrich, J., Chambers, C., Sirer, E.G., Eggers, S.J.: Static analyses for eliminating unnecessary synchronization from Java programs. In: SAS, pp. 19–38 (1999)

    Google Scholar 

  3. Bacon, D.F., Konuru, R., Murthy, C., Serrano, M.: Thin locks: Featherweight synchronization for Java. In: PLDI, pp. 258–268 (1998)

    Google Scholar 

  4. Bacon, D.F., Strom, R.E., Tarafdar, A.: Guava: a dialect of Java without data races. In: OOPSLA, pp. 382–400 (2000)

    Google Scholar 

  5. Blackburn, S.M., et al.: The DaCapo benchmarks: Java benchmarking development and analysis. In: OOPSLA, pp. 169–190 (2006)

    Google Scholar 

  6. Blanchet, B.: Escape analysis for object-oriented languages: application to Java. In: OOPSLA, pp. 20–34 (1999)

    Google Scholar 

  7. Bogda, J., Hölzle, U.: Removing unnecessary synchronization in Java. In: OOPSLA, pp. 35–46 (1999)

    Google Scholar 

  8. Borman, S.: Sensible sanitation – understanding the IBM Java garbage. IBM DeveloperWorks (August 2002)

    Google Scholar 

  9. Boyapati, C., Lee, R., Rinard, M.: Ownership Types for Safe Programming: Preventing Data Races and Deadlocks. In: OOPSLA, pp. 211–230 (2002)

    Google Scholar 

  10. Choi, J.-D., Gupta, M., Serrano, M., Sreedhar, V.C., Midkiff, S.: Escape analysis for Java. In: OOPSLA, pp. 1–19 (1999)

    Google Scholar 

  11. Choi, J.-D., Gupta, M., Serrano, M.J., Sreedhar, V.C., Midkiff, S.P.: Stack allocation and synchronization optimizations for Java using escape analysis. ACM Trans. Program. Lang. Syst. 25(6), 876–910 (2003)

    Article  Google Scholar 

  12. Clarke, D.: Object Ownership and Containment. PhD thesis, University of New South Wales, Australia (2001)

    Google Scholar 

  13. Clarke, D., Wrigstad, T.: External uniqueness is unique enough. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 176–200. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  14. Clarke, D., Wrigstad, T., Östlund, J., Johnsen, E.B.: Minimal Ownership for Active Objects. Technical Report SEN-R0803, CWI (2008)

    Google Scholar 

  15. Clarke, D.G., Potter, J., Noble, J.: Ownership types for flexible alias protection. In: OOPSLA, pp. 48–64 (1998)

    Google Scholar 

  16. Cunningham, D., Drossopoulou, S., Eisenbach, S.: Universe Types for Race Safety. In: VAMP 2007, September 2007, pp. 20–51 (2007)

    Google Scholar 

  17. Domani, T., Goldshtein, G., Kolodner, E.K., Lewis, E., Petrank, E., Sheinwald, D.: Thread-local heaps for Java. In: ISMM, pp. 76–87 (2002)

    Google Scholar 

  18. Flanagan, C., Freund, S.N., Lifshin, M., Qadeer, S.: Types for atomicity: Static checking and inference for Java. ACM TOPLAS 30(4), 1–53 (2008)

    Article  Google Scholar 

  19. Flanagan, C., Qadeer, S.: A type and effect system for atomicity. In: PLDI, pp. 338–349 (2003)

    Google Scholar 

  20. Goetz, B.: Java theory and practice: Urban performance legends, revisited. IBM DeveloperWorks (September 2005)

    Google Scholar 

  21. Jikes RVM homepage, http://jikesrvm.org/

  22. Joisha, P.G.: Compiler optimizations for nondeferred reference: counting garbage collection. In: ISMM, pp. 150–161 (2006)

    Google Scholar 

  23. Müller, P.: Modular Specification and Verification of Object-Oriented Programs. Springer, Heidelberg (2002)

    Book  MATH  Google Scholar 

  24. Noble, J., Vitek, J., Potter, J.: Flexible alias protection. In: Jul, E. (ed.) ECOOP 1998. LNCS, vol. 1445, pp. 158–185. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  25. OpenJDK, http://openjdk.java.net/

  26. Östlund, J., Wrigstad, T., Clarke, D., Åkerblom, B.: Ownership, uniqueness and immutability. In: TOOLS (2007)

    Google Scholar 

  27. Pizlo, F., Hosking, A.L., Vitek, J.: Hierarchical real-time garbage collection. In: LCTES, pp. 123–133 (2007)

    Google Scholar 

  28. Potanin, A.: Generic Ownership—A Practical Approach to Ownership and Confinement in OO Programming Languages. PhD thesis, Victoria University of Wellington (2007)

    Google Scholar 

  29. Russell, K., Detlefs, D.: Eliminating synchronization-related atomic operations with biased locking and bulk rebiasing. In: OOPSLA, pp. 263–272 (2006)

    Google Scholar 

  30. Spring, J.H., Privat, J., Guerraoui, R., Vitek, J.: StreamFlex: High-throughput Stream Programming in Java. In: OOPSLA, pp. 211–228 (2007)

    Google Scholar 

  31. Srinivasan, S., Mycroft, A.: Kilim: Isolation-typed actors for java. In: Vitek, J. (ed.) ECOOP 2008. LNCS, vol. 5142, pp. 104–128. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  32. Steensgaard, B.: Thread-specific heaps for multi-threaded programs. In: ISMM, pp. 18–24 (2000)

    Google Scholar 

  33. Wright, A.K., Felleisen, M.: A syntactic approach to type soundness. Inf. Comput. 115(1), 38–94 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  34. Wrigstad, T.: Ownership-Based Alias Management. PhD thesis, Royal Institute of Technology, Kista, Stockholm (2006)

    Google Scholar 

  35. Wrigstad, T., Clarke, D.: Existential owners for ownership types. Journal of Object Technology 4(6), 141–159 (2007)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Wrigstad, T., Pizlo, F., Meawad, F., Zhao, L., Vitek, J. (2009). Loci: Simple Thread-Locality for Java. In: Drossopoulou, S. (eds) ECOOP 2009 – Object-Oriented Programming. ECOOP 2009. Lecture Notes in Computer Science, vol 5653. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-03013-0_21

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-03013-0_21

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-03012-3

  • Online ISBN: 978-3-642-03013-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics