How could I go about achieving multithreading in a programming language compiled with cranelift? Is this a solved problem or do I have to implement it myself? If so am I better off offloading it to c?
Should be largely orthogonal to the compiler backend: whatever multithreading primitives you need should be implemented in your language's runtime (e.g., starting threads, mutex locks, etc.) If you need to implement low-level synchronization primitives in Cranelift-compiled code, it does have atomic instructions (see atomic_rmw
and atomic_cas
as well as atomic_load
, atomic_store
)
Thanks for the information!
Till Schneidereit has marked this topic as resolved.
Last updated: Dec 23 2024 at 12:05 UTC