3 ms·
> Once your process starts using threads, suddenly every bit of state in it can be shared by all threads. Only when you use highly inconvenient model of shared
by dozzie 13y ago
> Once your process starts using threads, suddenly every bit of state in it can be shared by all threads.
Only when you use highly inconvenient model of shared memory. Message passing and shared-nothing combined, as it is done in Erlang or Go, are way easier to reason about, giving at the same time more natural way of structuring code than events handling.
- joosters 13y agoI agree! It's a shame that the most common concurrent programming models are a choice between share-nothing (fork) and share-everything (threads). Anything that gives a programmer something between the two extremes is an improvement.
- merijnv 13y agoOr when using the highly inconvenient model of mutable state ;) Purely functional language can share state between threads just fine, since any state will be immutable (barring any explicit communication primitives).