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
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsNotes
- 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.
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.
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.
In addition to disjoint effects, two async blocks in the same finish must not update the same variable—a trivial compile-time analysis.
- 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
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)
Bocchino, R.: An effect system and language for deterministic-by-default parallel programming, 2010. Ph.D. thesis, University of Illinois at Urbana-Champaign (2010)
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)
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)
Bocchino, R., Aldrich, J.: Reference groups for local uniqueness. Technical report, CMU (to appear)
Boyland, J.: Alias burying: unique variables without destructive reads. Softw. Pract. Exp. 31(6), 533–553 (2001)
Boyland, J.T., Retert, W.: Connecting effects and uniqueness with adoption. In: POPL, pp. 283–295 (2005)
Castegren. E.: Laps : a general framework for modeling alias management using access permission sets, Master thesis (2012)
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)
Clarke, D.: Object ownership and containment. Ph.D. thesis, School of Computer Science and Engineering, University of New South Wales, Australia (2002)
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. In: Ramalingam, G. (ed.) APLAS 2008. LNCS, vol. 5356, pp. 139–154. Springer, Heidelberg (2008)
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)
Clarke, D.G., Drossopoulou, S.: Ownership, encapsulation and the disjointness of type and effect. In: OOPSLA, pp. 292–310 (2002)
Clarke, D.G., Potter, J., Noble, J.: Ownership types for flexible alias protection. In: OOPSLA, pp. 48–64 (1998)
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)
Cunningham, D., Drossopoulou, S., Eisenbach, S.: Universes for Race Safety (2007)
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
Fähndrich, M., DeLine, R.: Adoption and focus: practical linear types for imperative programming. In: PLDI, pp. 13–24 (2002)
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)
Greenhouse, A., Boyland, J.: An object-oriented effects system. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, pp. 205–229. Springer, Heidelberg (1999)
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)
Lee, J.K., Palsberg, J.: Featherweight x10: a core calculus for async-finish parallelism. In: PPOPP, pp. 25–36 (2010)
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)
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)
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)
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)
Milanova, A., Huang, W.: Static object race detection. In: Yang, H. (ed.) APLAS 2011. LNCS, vol. 7078, pp. 255–271. Springer, Heidelberg (2011)
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)
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)
Östlund, J., Brandauer, S., Wrigstad, T.: The joelle programming language : evolving java programs along two axes of parallel eval. In: LaME 2012 (2012)
Ö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)
Ö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)
Ö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)
Potanin, A., Noble, J., Clarke, D., Biddle, R.: Generic ownership for generic Java. In OOPSLA, pp. 311–324 (2006)
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)
Strnisa, R., Parkinson, M.J.: Lightweight java. In: Archive of Formal Proofs (2011)
Wrigstad, T.: Ownership-Based Alias Management. Ph.D. thesis, Royal Institute of Technology, Kista, Stockholm, May 2006
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights 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)