4 ms·
This comment has made me realise that one of the key ideas of the Erlang runtime (over other concurrency implementations) is the link. For those of you not fami
by rkangel 5y ago
This comment has made me realise that one of the key ideas of the Erlang runtime (over other concurrency implementations) is the link. For those of you not familiar with it, rather than just starting a process independently, you can start a process linked to your current process. If either of you die, the VM kills the other one.
This sounds like a fairly simplistic primitive operation, but what it means is that you can start a whole set of processes that are logically linked together (e.g. because they handle one web request) and if anything happens they all get killed together. This means you get almost the simplicity of error handling of throwing an exception in a single thread of code, but with all the concurrency, parallelism and locality of reference that you get with multiple actors doing the work.