madsim-rs / madsim

Magical Deterministic Simulator for distributed systems in Rust.
Apache License 2.0
662 stars 48 forks source link

Enhancing Determinism by Forking Processes #174

Open wangrunji0408 opened 11 months ago

wangrunji0408 commented 11 months ago

Currently, in madsim, running multiple simulations of the same program occurs within the same process. However, real-world programs inevitably use static variables, which can lead to different initial states for each simulation, resulting in non-deterministic outcomes. To resolve this issue, we can first fork a new process and then run the simulation.