No Touchy! A Case Study of Software Architecture with Immutable Objects
summary
ViewRay builds a C++17 multi‑process, multi‑thread control stack for MRI‑guided radiotherapy that uses React‑Redux style immutable state so every change is a shallow copy with lockless detaches and synchronized write transactions. The implementation ships as the cusco library (ibob/cusco), supports tens of state updates per second, vastly simplifies unit/integration testing and state serialization, and survives aborted/outdated worker results by discarding them. It struggles with large in‑memory images (frequent copies, reallocations, cache misses) and requires custom container/allocator workarounds for voxel‑level mutations.
AI-written summary · about
chapters (30)
- 0:00Introduction
- 0:51Live demo of cancer treatment
- 2:30Treatment optimization
- 5:31Innovative treatment delivery
- 6:21Architecture overview
- 8:03Service and worker breakdown
- 9:25Object wrapper design
- 10:48Implementing copy-on-write
- 12:38Object handles and atomic operations
- 15:44The immutable object pattern
- 18:34Terminology and detach mechanics
- 21:09React.js comparison
- 22:53State splicing and reflection
- 25:03Benefits of immutable state
- 26:58Unit testing and verification
- 29:32Time-travel debugging
- 31:27C++ implementation details
- 34:09Refining node structure
- 36:26Cusco library features
- 39:20Handling large data structures
- 41:43Custom containers and allocation
- 44:40Limitations and workarounds
- 45:40Query system for reuse
- 47:52Action and Redux implementation
- 50:14State guards and validation
- 52:17Memoized guards and observers
- 53:26GUI and user interactions
- 55:02Worker management and logic
- 57:23Conclusion and Q&A
- 59:16Technical Q&A
related talks
38mImmutability is everything!
59mThe Most Valuable Values
01h 02m“Beyond the Issaquah Challenge: High-Performance Scalable Complex Updates"
37mAvoiding the dogma - a plea for mutable objects
01h 02mObjects vs Values: Value Oriented Programming in an Object Oriented World
39mTemporal Dynamics - Exploring the Intricacies of Object Lifetimes in Modern C++
40mReduce System Complexity with Data-Oriented Programming
01h 08mThinking Outside the Synchronisation Quadrant
