5 ms·
Could someone elaborate (or link to a reference) on Joe's point about how having many processes can help build fault tolerant systems? I know next to nothing ab
by ssivark 8y ago
Could someone elaborate (or link to a reference) on Joe's point about how having many processes can help build fault tolerant systems? I know next to nothing about Erlang/Elixir or the actor model, but I'm curious about the underlying principles. My primary interest for now is not necessarily in scalability, but actually in engineering fault-tolerant systems.
EDIT: To give some more context... I'm thinking about software systems that must interact with the real world (eg: robotics) where it is very hard to give guarantees that a certain action would necessarily have the desired effect. Also, it is very common for agents to function with an incomplete model of the world (which essentially encodes their assumptions on how the world ought to respond to their actions) and keep adapting their responses and changing their model based on observations. (BTW, thinking along these lines lead to an approach called behavior-based robotics)
- thijsvandien 8y agoHe wrote a whole PhD thesis about it, so that's where I'd start if you're interested in the topic.
- di4na 8y agoJoe Thesis is probably the best place to begin with. http://erlang.org/download/armstrong_thesis_2003.pdf http://erlang.org/download/armstrong_thesis_2003.pdf
- ssivark 8y agoThanks for the link; will read.
- rdtsc 8y agoThe key is that the memory of these processes is isolated from all the others. Think of how operating system process work. You can restart a small group out of 1 million and have confidence the rest are not affected. That is a powerful and awesome ability. Imagine you have a million threads all sharing the same data structures with complicated barriers, locks, mutexes, and condition variables. Some subset of them crash, can you confidently restart just those threads? Usually no, because they could have scribble on the memory that other threads will use, or might be holding some lock and such. In operating systems terminology it's like when your calculator app crashed and it took down your word processor as well in Windows 3.1 days.
- PopeDotNinja 8y agoYou know how you can write a daemon that starts a service, and then restarts the service if it crashes. Usually you'd use a service like that in your operating system init process: System V, Launchd, Systemd, Runit, etc. Now imagine the ability to do that in a program. You can write an elixir process, start it with a supervisor, and if the process crashes, the supervisor automatically traps the exit signal & and starts a new process. No messing around with operating system init shenanigans required!