Commit bf4c496
committed
Thread safety infrastructure for shared IrContainer
Add std::shared_mutex to IrContainer to protect shared mutable state
during concurrent access from parallel compilation threads.
- IrContainer public methods self-lock (shared_lock for reads,
unique_lock for writes)
- Fusion mutation methods (registerVal/Expr, removeVal/Expr,
removeStatementsCreatedAfter) acquire unique_lock then delegate to
lock-free ContainerMutator static methods, avoiding self-deadlock
on nested calls (e.g., removeVal → removeExpr)
- ContainerMutator is a PIMPL struct defined only in fusion.cpp,
keeping lock-free impl methods out of the header
- Remove kPhase2DisableParallelCompile guard, re-enabling parallel
compilation now that the mutex is in place
- Delete dead IrContainer::copy() and IrContainer::swap() methods1 parent e5256e7 commit bf4c496
File tree
5 files changed
+293
-273
lines changed- csrc
- ir
- runtime
5 files changed
+293
-273
lines changed
0 commit comments