3 ms·
Erlang has schedulers (one per CPU) that schedules when code gets run. If an Erlang process (Erlang's unit of computation/concurrency) is tied up doing IO, the
by rubiquity 12y ago
Erlang has schedulers (one per CPU) that schedules when code gets run. If an Erlang process (Erlang's unit of computation/concurrency) is tied up doing IO, the scheduler simply jumps to another Erlang process. In Node.js you write out callbacks/promises/soup du jour that get run after some specified thing completes. In Erlang your code looks completely sequential.
- dietrichepp 12y agoAnd on Node.js, whatever thing you run probably gets put into a bog-standard thread pool. So all that's really happening is that your IO requests are getting sent to a limited number of long-running threads. Run enough operations at the same time and you can tie up the thread pool, which most people don't even know exists. In some ways, it's the worst of both worlds: it has the limitations of a thread pool with the API complexity of a callback system.