Fuzion Logo
fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

Concurrency

TBW!

Basic idea: As long as data that is accessed by different threads is immutable, concurrency is easy. Threads can share data, data can be copied to local caches or local memory in a NUMA system. The idea is not to force all data to be immutable, but to perform static analysis that ensures that mutable data remains local to the thread that is mutating it.

But how should threads communicate? Synchronization like in Java or Rust is too error prone, we do not want any chance to run into a deadlock.

One solution to consider might be to regard each thread as running in its own parallel universe, where either static analysis ensures that no mutations affect any other threads, or a copy-on-write mechanism ensures that mutations stay local to the current thread. (the latter does not sound very useful to me, though).

Some pre-defined worm-holes could allow communication between these threads. A worm-hole is some communication channel with the ends being local to different threads (à la CSP).

When handing over data from one thread to another, it has to be ensured that the original thread no longer modifies the data, maybe even no longer accesses the data. Rust's ownership model is a way to do this, but IMHO too complex. To what extend can static analysis solve this?