logoalt Hacker News

zozbot234last Sunday at 4:53 PM1 replyview on HN

> Erlang, at least the programming model, lends itself well to this, where each process has a local heap.

That loosely describes plenty of multithreaded workloads, perhaps even most of them. A thread that doesn't keep its memory writes "local" to itself as much as possible will run into heavy contention with other threads and performance will suffer a lot. It's usual to try and write multithreaded workloads in a way that tries to minimize the chance of contention, even though this may not involve a literal "one local heap per core".


Replies

bglusmanlast Monday at 12:47 PM

Yes, but in Erlang, everything on every process is immutable and nothing is ever trying to write anywhere besides locally. Every variable assignment leaves the previous memory unchanged and fully accessible to anything directly referencing it.