Chapter

Formal Methods for Multicore Programming

Volume 9104 of the series Lecture Notes in Computer Science pp 179-210

Date:

Refined Ownership:

Fine-Grained Controlled Internal Sharing
  • Elias CastegrenAffiliated withUppsala University
  • , Johan ÖstlundAffiliated withUppsala University Email author 
  • , Tobias WrigstadAffiliated withUppsala University

* Final gross prices may vary according to local VAT.

Get Access

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.