Module stack

Module stack 

Source
Expand description

A thread-safe collection for managing multiple progress indicators.

The ProgressStack serves as the central registry for “Multi-Bar” applications. It allows a renderer to iterate over a dynamic list of active tasks without fighting the worker threads for locks.

§Synchronization Strategy

The stack uses a coarse-grained RwLock to protect the list of handles. Individual progress updates (incrementing counters) do not lock the stack.

  • Workers: Only acquire the stack lock when adding/removing a bar (rare).
  • Renderers: Acquire a read lock on the stack once per frame to clone the handles, then iterate independently.

Structs§

ProgressStack
A thread-safe, shared-clonable collection of Progress instances.
ProgressStackSnapshot
A snapshot of the state of the entire progress stack at a specific point in time.