Search code examples
node.jserlangblockingnonblocking

calling a blocking library in node.js vs erlang vm


In node.js, if my thread calls a blocking library, it can't accept any more requests until it gets back a response from the library. Is this the same situation with the Erlang virtual machine - i.e., can other processes keep accepting requests if one of the processes makes a call to a blocking library?


Solution

  • In Erlang, a process might block, but the Erlang scheduler will not block. Other processes will continue to be executed / given time by the scheduler. There are some calls like erlang:now that block all for a very short time, but there are non-blocking alternatives. If I recall correctly, Ericson is working hard to remove all blocking stuff from the Erlang VM. and most blocks are subtle edge-cases. For example: in R16, the last release, they fixed blocking hot-code upgrades.

    See also ERLANG wait() and blocking