Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

The Standard Library as Architecture

StdlibOwnership across a large workspaceRevision 1b998fc
  • Arc makes Arrow buffers, chunks, stores, and runtime services cheap to pass across readers without copying image or point data.
  • Weak lets handles observe shared recording state without forcing it to stay alive forever.
  • Mutex and RwLock distinguish small mutable control state from stores with many readers and serialized insertion.
  • AtomicI64 assigns recording ticks without acquiring the larger stream lock.
  • HashMap, range maps, and ordered indexes encode the multiple lookup axes of entity, timeline, component, chunk ID, and time.
  • std::thread::JoinHandle proves ownership of native batcher/forwarder lifecycle. Drop sends shutdown and joins after disconnecting bounded output so teardown cannot deadlock on a full queue.
  • std::sync::mpsc::sync_channel(0) appears as a tiny acknowledgement rendezvous for operations such as flush; it is not confused with the bulk data path.
  • cfg(target_arch = "wasm32") makes absent platform capabilities explicit at compile time.

The standard library defines who owns long-lived state. Tokio, Crossbeam, Rayon, egui, Arrow, and wgpu fill narrower execution and representation roles.