Skip to main content

run_vm_workstealing_seeded

Function run_vm_workstealing_seeded 

Source
pub fn run_vm_workstealing_seeded(
    input: &str,
    seed: u64,
    workers: usize,
) -> InterpreterResult
Expand description

run_vm_concurrent_seeded under the work-stealing M:N driver: workers OS-thread workers poll task bodies in parallel while one coordinator owns the scheduler and applies channel ops + flushes output in deterministic pick order. The observable result is byte-identical to the cooperative driver at the same seed (diff_cooperative_eq_workstealing_seeded) — the difference is that task bodies genuinely run on multiple cores.

The executor uses scoped threads, so each worker borrows the one shared, immutable program (+ policies + interner) — no clone, no leak. Only a Send SpawnDesc crosses a worker boundary; the worker rebuilds the !Send task body locally from it.