Hacker News new | ask | show | jobs
by opnitro 1495 days ago
Right, but you'd still need to synchronize that with some concurrency primitives (like a mutex or semaphore) and that has the potential for bugs. Whereas on an immutable structure can't suffer from that problem, which can make concurrent programming easier to reason about.
1 comments

> Right, but you'd still need to synchronize that with some concurrency primitives (like a mutex or semaphore)

Why? If you know your thread won't be interleaved with any other until you a well-defined point, how's that different to using a mutex or semaphore?

IIUC, Loom threads can be scheduled across multiple OS threads (much like go-routines), so there is (at least the possibility of) real concurrency going on.