graph LR subgraph before["Before (aberth.cpp, rootfinding.cpp)"] A["aberth (ST)"] --> C["thread_pool usage"] B["aberth_mt (MT)"] --> C D["pbairstow_even_st"] --> E["thread_pool usage"] F["pbairstow_even_mt"] --> E end style A fill:#fff9c4,stroke:#f57f17,stroke-width:3px style B fill:#fff9c4,stroke:#f57f17,stroke-width:3px style C fill:#c8e6c9,stroke:#2e7d32,stroke-width:3px style D fill:#fff9c4,stroke:#f57f17,stroke-width:3px style E fill:#c8e6c9,stroke:#2e7d32,stroke-width:3px style F fill:#fff9c4,stroke:#f57f17,stroke-width:3px
graph LR subgraph st["ST module (header + source)"] A["aberth.hpp / aberth.cpp"] B["rootfinding.hpp / rootfinding.cpp"] end subgraph mt["MT module (header + source)"] C["aberth_mt.hpp / aberth_mt.cpp"] D["rootfinding_mt.hpp / rootfinding_mt.cpp"] E["autocorr_mt.hpp / autocorr_mt.cpp"] end A --> C B --> D B --> E style A fill:#e3f2fd,stroke:#1565c0,stroke-width:3px style B fill:#e3f2fd,stroke:#1565c0,stroke-width:3px style C fill:#ffccbc,stroke:#bf360c,stroke-width:3px style D fill:#ffccbc,stroke:#bf360c,stroke-width:3px style E fill:#ffccbc,stroke:#bf360c,stroke-width:3px
sequenceDiagram participant W as Writer (job i) participant S as Slot (AtomicComplex) participant R as Reader (job j) W->>S: seq++ (odd) ยท write re, im S-->>R: reader loop R->>S: s1 = seq.load() R->>S: read re, im R->>S: s2 = seq.load() alt s1 == s2 and even R-->>R: return torn-free pair โ else R-->>R: retry ๐ end W->>S: seq++ (even) โ stable