3 ms·
Lightweight threads in Erlang/Elixir were created as a unit of fault tolerance. A lightweight thread can suddenly exit when it hits an error, and the VM mechani
by ramchip 6y ago
Lightweight threads in Erlang/Elixir were created as a unit of fault tolerance. A lightweight thread can suddenly exit when it hits an error, and the VM mechanisms give you guarantees that any resource it owned will be freed (memory, sockets, registered name, ETS tables, etc.) Using signals and monitors you can extend this to any other type of resources, for instance DB connections in an SQL adapter library.
That's the original advantage over OS threads.
- otabdeveloper4 6y agoNo, you don't need cooperative threads for this. Proper exception handling fixes this problem with OS threads for you.