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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Java theory and practice: Synchronization optimizations in mustang, http://www-128.ibm.com/developerworks/java/library/j-jtp10185/
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)
Bacon, D.F., Konuru, R., Murthy, C., Serrano, M.: Thin locks: Featherweight synchronization for Java. In: PLDI, pp. 258–268 (1998)
Bacon, D.F., Strom, R.E., Tarafdar, A.: Guava: a dialect of Java without data races. In: OOPSLA, pp. 382–400 (2000)
Blackburn, S.M., et al.: The DaCapo benchmarks: Java benchmarking development and analysis. In: OOPSLA, pp. 169–190 (2006)
Blanchet, B.: Escape analysis for object-oriented languages: application to Java. In: OOPSLA, pp. 20–34 (1999)
Bogda, J., Hölzle, U.: Removing unnecessary synchronization in Java. In: OOPSLA, pp. 35–46 (1999)
Borman, S.: Sensible sanitation – understanding the IBM Java garbage. IBM DeveloperWorks (August 2002)
Boyapati, C., Lee, R., Rinard, M.: Ownership Types for Safe Programming: Preventing Data Races and Deadlocks. In: OOPSLA, pp. 211–230 (2002)
Choi, J.-D., Gupta, M., Serrano, M., Sreedhar, V.C., Midkiff, S.: Escape analysis for Java. In: OOPSLA, pp. 1–19 (1999)
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)
Clarke, D.: Object Ownership and Containment. PhD thesis, University of New South Wales, Australia (2001)
Clarke, D., Wrigstad, T.: External uniqueness is unique enough. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 176–200. Springer, Heidelberg (2003)
Clarke, D., Wrigstad, T., Östlund, J., Johnsen, E.B.: Minimal Ownership for Active Objects. Technical Report SEN-R0803, CWI (2008)
Clarke, D.G., Potter, J., Noble, J.: Ownership types for flexible alias protection. In: OOPSLA, pp. 48–64 (1998)
Cunningham, D., Drossopoulou, S., Eisenbach, S.: Universe Types for Race Safety. In: VAMP 2007, September 2007, pp. 20–51 (2007)
Domani, T., Goldshtein, G., Kolodner, E.K., Lewis, E., Petrank, E., Sheinwald, D.: Thread-local heaps for Java. In: ISMM, pp. 76–87 (2002)
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)
Flanagan, C., Qadeer, S.: A type and effect system for atomicity. In: PLDI, pp. 338–349 (2003)
Goetz, B.: Java theory and practice: Urban performance legends, revisited. IBM DeveloperWorks (September 2005)
Jikes RVM homepage, http://jikesrvm.org/
Joisha, P.G.: Compiler optimizations for nondeferred reference: counting garbage collection. In: ISMM, pp. 150–161 (2006)
Müller, P.: Modular Specification and Verification of Object-Oriented Programs. Springer, Heidelberg (2002)
Noble, J., Vitek, J., Potter, J.: Flexible alias protection. In: Jul, E. (ed.) ECOOP 1998. LNCS, vol. 1445, pp. 158–185. Springer, Heidelberg (1998)
OpenJDK, http://openjdk.java.net/
Östlund, J., Wrigstad, T., Clarke, D., Åkerblom, B.: Ownership, uniqueness and immutability. In: TOOLS (2007)
Pizlo, F., Hosking, A.L., Vitek, J.: Hierarchical real-time garbage collection. In: LCTES, pp. 123–133 (2007)
Potanin, A.: Generic Ownership—A Practical Approach to Ownership and Confinement in OO Programming Languages. PhD thesis, Victoria University of Wellington (2007)
Russell, K., Detlefs, D.: Eliminating synchronization-related atomic operations with biased locking and bulk rebiasing. In: OOPSLA, pp. 263–272 (2006)
Spring, J.H., Privat, J., Guerraoui, R., Vitek, J.: StreamFlex: High-throughput Stream Programming in Java. In: OOPSLA, pp. 211–228 (2007)
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)
Steensgaard, B.: Thread-specific heaps for multi-threaded programs. In: ISMM, pp. 18–24 (2000)
Wright, A.K., Felleisen, M.: A syntactic approach to type soundness. Inf. Comput. 115(1), 38–94 (1994)
Wrigstad, T.: Ownership-Based Alias Management. PhD thesis, Royal Institute of Technology, Kista, Stockholm (2006)
Wrigstad, T., Clarke, D.: Existential owners for ownership types. Journal of Object Technology 4(6), 141–159 (2007)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)