Shared mutability in Rust Part 2 of 3: Acyclic graphs

Andrew Pritchard
13 min readSep 17, 2019

Summary

  • Child entities which are both mutable and shared can make any, or all of their parents invalid.
  • In freeform shared mutability, we cannot cache any calculation that depends on a shared mutable entity.
  • If we limit the scope of sharing to code we trust not to invalidate our cache, then we can cache results as much as we like.
  • Limiting the scope of sharing implies that we have some kind of container entity: an Arena.

--

--

Andrew Pritchard

The stories I write are a part of a learning journey through life, logic and programming. Share this journey with me.