-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Several modules in the codebase use an AtomicCell<bool> as an error flag to signal errors between threads (e.g., let error = AtomicCell::new(false);). Each thread sets error.store(true) on error, and other threads check if error.load() to decide whether to exit early. This pattern is used in addition to channels for inter-thread communication.
src/params/peel/mod.rssrc/params/vis_convert.rssrc/params/vis_subtract.rssrc/params/di_calibration.rssrc/params/vis_simulate.rssrc/cli/vis_utils/simulate/mod.rs
In all these cases, threads are already communicating via channels. If a thread encounters an error and exits, it will close its end of the channel, and other threads will receive a SendError or RecvError and can exit cleanly.
The explicit AtomicCell is redundant and adds unnecessary complexity. Relying on channel closure is more idiomatic and robust in Rust.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels