Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Cooperative vs. Preemptive multitasking is not the same as Light threads vs. OS threads/processes. Erlang (and also Haskell for example) does preemptive multitasking with light threads. And that's what I'm talking about.

Yeah, preemptive multitasking may be costly. But as you say, when you have lots of users, most of their tasks are sleeping or waiting for timers. That's where preemptive multitasking excels. You can have millions of sleeping tasks and several (at times) doing real work. That's why Erlang is "scalable" and node.js is not. Especially if you need to have state in your workers and if you need them to live longer.

Saying that node's cooperative multitasking excels in IO-bound computation is a clear sign that you haven't tried Erlang.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: