Skip to main content

Refined Ownership:

Fine-Grained Controlled Internal Sharing

  • Chapter
  • First Online:
  • 652 Accesses

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

Abstract

Ownership type systems give a strong notion of separation between aggregates. Objects belonging to different owners cannot be aliased, and thus a mutating operation internal to one object is guaranteed to be invisible to another. This naturally facilitates reasoning about correctness on a local scale, but also proves beneficial for coarse-grained parallelism as noninterference between statements touching differentobjects is easily established. For fine-grained parallelism, ownership types fall short as owner-based disjointness only allows separation of the innards of different aggregates, which is very coarse-grained. Concretely: ownership types can reason about the disjointness of two different data structures, but cannot reason about the internal structure or disjointness within the data structure, without resorting to static and overly constraining measures. For similar reasons, ownership fails to determine internal disjointness of external pointers to objects that share a common owner.

In this paper, we introduce the novel notion of refined ownership which overcomes these limitations by allowing precise local reasoning about a group of objects even though they belong to the same external owner. Using refined ownership, we can statically check determinism of parallel operations on tree-shaped substructures of a data structure, including operations on values external to the structure, without imposing any non-local alias restrictions.

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.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

Learn about institutional subscriptions

Notes

  1. 1.

    We would like to note that there’s risk of confusion as to which tree is focused on when focusing on an owner that is used multiple times in a type. The solution is simple and just requires that the programmer is explicit about which parameter is meant, however we leave this out in the examples and the formalism because it does not add to the story.

  2. 2.

    The formalism notably uses explicit destructive reads and unique pointers for simplicity, but these can be inferred in the actual language implementation. See however anecdotal evidence by Gordon et al. [20] that programmers appreciate explicit operations on uniques.

  3. 3.

    This is called the movement bound and investigated further in [11]. It is required for soundness of ownership transfer, but otherwise of little relevance for refined ownership.

  4. 4.

    In addition to disjoint effects, two async blocks in the same finish must not update the same variable—a trivial compile-time analysis.

  5. 5.

    The tree rooted in last in Fig. 7 notably stops immediately after its first object. To create trees which overlap in “interesting ways,” e.g., a doubly-linked lists additional machinery is needed, e.g., a “splitting operator” that allows introduction of multiple aliases to a value which are bound to different trees. We do not yet have a convincing simple extension for this, and refer to future work.

References

  1. Aldrich, J., Chambers, C.: Ownership domains: separating aliasing policy from mechanism. In: Odersky, M. (ed.) ECOOP 2004. LNCS, vol. 3086, pp. 1–25. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  2. Bocchino, R.: An effect system and language for deterministic-by-default parallel programming, 2010. Ph.D. thesis, University of Illinois at Urbana-Champaign (2010)

    Google Scholar 

  3. Bocchino Jr., R.L., Adve, V.S.: Types, regions, and effects for safe programming with object-oriented parallel frameworks. In: Mezini, M. (ed.) ECOOP 2011. LNCS, vol. 6813, pp. 306–332. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  4. Bocchino, R., Adve, V.S., Dig, D., Adve, S.V., Heumann, S., Komuravelli, R., Overbey, J., Simmons, P., Sung, H., Vakilian, M.: A type and effect system for deterministic parallel Java. In: OOPSLA, pp. 97–116 (2009)

    Google Scholar 

  5. Bocchino, R., Aldrich, J.: Reference groups for local uniqueness. Technical report, CMU (to appear)

    Google Scholar 

  6. Boyland, J.: Alias burying: unique variables without destructive reads. Softw. Pract. Exp. 31(6), 533–553 (2001)

    Article  MATH  Google Scholar 

  7. Boyland, J.T., Retert, W.: Connecting effects and uniqueness with adoption. In: POPL, pp. 283–295 (2005)

    Google Scholar 

  8. Castegren. E.: Laps : a general framework for modeling alias management using access permission sets, Master thesis (2012)

    Google Scholar 

  9. Cavé, V., Zhao, J., Shirako, J., Sarkar, V.: Habanero-java: the new adventures of old x10. In: Proceedings of the 9th International Conference on Principles and Practice of Programming in Java, PPPJ 2011, pp. 51–61. ACM, New York (2011)

    Google Scholar 

  10. Clarke, D.: Object ownership and containment. Ph.D. thesis, School of Computer Science and Engineering, University of New South Wales, Australia (2002)

    Google Scholar 

  11. 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 

  12. Clarke, D., Wrigstad, T., Östlund, J., Johnsen, E.B.: Minimal ownership for active objects. In: Ramalingam, G. (ed.) APLAS 2008. LNCS, vol. 5356, pp. 139–154. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  13. Clarke, D., Östlund, J., Sergey, I., Wrigstad, T.: Ownership types: a survey. In: Clarke, D., Noble, J., Wrigstad, T. (eds.) Aliasing in Object-Oriented Programming. LNCS, vol. 7850, pp. 15–58. Springer, Heidelberg (2013)

    Google Scholar 

  14. Clarke, D.G., Drossopoulou, S.: Ownership, encapsulation and the disjointness of type and effect. In: OOPSLA, pp. 292–310 (2002)

    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. Craik, A., Kelly, W.: Using ownership to reason about inherent parallelism in object-oriented programs. In: Gupta, R. (ed.) CC 2010. LNCS, vol. 6011, pp. 145–164. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  17. Cunningham, D., Drossopoulou, S., Eisenbach, S.: Universes for Race Safety (2007)

    Google Scholar 

  18. Dietl, W.M.: Universe Types: Topology, Encapsulation, Genericity, and Tools. Ph.D., Department of Computer Science, ETH Zurich, Doctoral Thesis ETH No. 18522, December 2009

    Google Scholar 

  19. Fähndrich, M., DeLine, R.: Adoption and focus: practical linear types for imperative programming. In: PLDI, pp. 13–24 (2002)

    Google Scholar 

  20. Gordon, C.S., Parkinson, M.J., Parsons, J., Bromfield, A., Duffy, J.: Uniqueness and reference immutability for safe parallelism. In: OOPSLA, pp. 21–40 (2012)

    Google Scholar 

  21. Greenhouse, A., Boyland, J.: An object-oriented effects system. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, pp. 205–229. Springer, Heidelberg (1999)

    Google Scholar 

  22. Igarashi, A., Pierce, B.C., Wadler, P.: Featherweight java: a minimal core calculus for Java and GJ. ACM Trans. Program. Lang. Syst. 23(3), 396–450 (2001)

    Article  Google Scholar 

  23. Lee, J.K., Palsberg, J.: Featherweight x10: a core calculus for async-finish parallelism. In: PPOPP, pp. 25–36 (2010)

    Google Scholar 

  24. Lu, Y.: A type system for reachability and acyclicity. In: Gao, X.-X. (ed.) ECOOP 2005. LNCS, vol. 3586, pp. 479–503. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  25. Lu, Y., Potter, J., Xue, J.: Ownership types for object synchronisation. In: Jhala, R., Igarashi, A. (eds.) APLAS 2012. LNCS, vol. 7705, pp. 18–33. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  26. Lu, Y., Potter, J., Xue, J.: Structural lock correlation with ownership types. In: Felleisen, M., Gardner, P. (eds.) ESOP 2013. LNCS, vol. 7792, pp. 391–410. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  27. Lu, Y., Potter, J., Zhang, C., Xue, J.: A type and effect system for determinism in multithreaded programs. In: Seidl, H. (ed.) ESOP 2012. LNCS, vol. 7211, pp. 518–538. Springer, Heidelberg (2012)

    Google Scholar 

  28. Milanova, A., Huang, W.: Static object race detection. In: Yang, H. (ed.) APLAS 2011. LNCS, vol. 7078, pp. 255–271. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  29. Müller, P., Poetzsch-Heffter, A.: Universes: a type system for controlling representation exposure. In.Fernuniversität Hagen Programming Languages and Fundamentals of Programming (1999)

    Google Scholar 

  30. Nystrom, N., Clarkson, M.R., Myers, A.C.: Polyglot: an extensible compiler framework for java. In: Hedin, G. (ed.) CC 2003. LNCS, vol. 2622, pp. 138–152. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  31. Östlund, J., Brandauer, S., Wrigstad, T.: The joelle programming language : evolving java programs along two axes of parallel eval. In: LaME 2012 (2012)

    Google Scholar 

  32. Östlund, J., Wrigstad, T.: Regions as owners - a discussion on ownership-based effects in practice. In: IWACO 2011, International Workshop on Aliasing, Confinement and Ownership in Object-Oriented Programming (2011)

    Google Scholar 

  33. Östlund, J., Wrigstad, T.: Multiple aggregate entry points for ownership types. In: Noble, J. (ed.) ECOOP 2012. LNCS, vol. 7313, pp. 156–180. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  34. Östlund, J., Wrigstad, T., Clarke, D., Åkerblom, B.: Ownership, uniqueness, and immutability. In: Paige, R.F., Meyer, B. (eds.) TOOLS. LNCS, pp. 178–197. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  35. Potanin, A., Noble, J., Clarke, D., Biddle, R.: Generic ownership for generic Java. In OOPSLA, pp. 311–324 (2006)

    Google Scholar 

  36. Servetto, M., Pearce, D. J., Groves, L., Potanin, A.: Balloon types for safe parallelisation over arbitrary object graphs. In: 4th Workshop on Determinism and Correctness in Parallel Programming (2013)

    Google Scholar 

  37. Strnisa, R., Parkinson, M.J.: Lightweight java. In: Archive of Formal Proofs (2011)

    Google Scholar 

  38. Wrigstad, T.: Ownership-Based Alias Management. Ph.D. thesis, Royal Institute of Technology, Kista, Stockholm, May 2006

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Johan Östlund .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer International Publishing Switzerland

About this chapter

Cite this chapter

Castegren, E., Östlund, J., Wrigstad, T. (2015). Refined Ownership:. In: Bernardo, M., Johnsen, E. (eds) Formal Methods for Multicore Programming. SFM 2015. Lecture Notes in Computer Science(), vol 9104. Springer, Cham. https://doi.org/10.1007/978-3-319-18941-3_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-18941-3_5

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-18940-6

  • Online ISBN: 978-3-319-18941-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics