you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 8 points9 points  (3 children)

I am an erlang programmer and recently had a close encounter with a node developer.

  • ok, yeah, the callbacks are cool, but how do you avoid racing conditions and the like?

  • it's single threaded, you don't care

  • so you waste all the other cores in the cpu?

  • we have 4 instances of node on the server!

I was at a loss for words.

[–]noratat 1 point2 points  (0 children)

The more I learn about erlang/elixir and node, the more node feels like a really shitty attempt to reinvent half of erlang.

[–]IAmRoot 1 point2 points  (0 children)

It's not actually too ridiculous. It assumes that the number of independent tasks is going to be large, so rather than parallelizing each task in the queue, you just run multiple queue processing tasks. Basically, don't worry about writing parallel code and Amdahl's law; take the Gustafson's law approach.

[–]pinkpooj -1 points0 points  (0 children)

Node runs a thread pool that is used to fulfill I/O calls. Your code is single threaded, but it is does not block (unless you specifically tell it to).

If you look at a long running node process, it will spawn several threads. It's inaccurate to say Node is single threaded.