News for hackers. Stuff that matters.
Re:Mistakes Node.js Developers Make by LewisJEllis on Saturday January 03, 2015 @05:07AM (#8830406)
"You're too stupid to handle this, just stick to PHP" - really?

If a developer can't grasp Node well enough to avoid blocking the event loop, I certainly wouldn't want them trying to handle a thousand connected clients with PHP!

Anyway, to answer your question - within a single node process no, not really. If something on the event loop goes into an infinite loop, timeouts will be of no use, and all other open requests are gonna be toast. This is just a downside to cooperative multitasking.

Re:Mistakes Node.js Developers Make by madawan on Saturday January 03, 2015 @10:28AM (#8830934)
Some problems might be easier to solve in one language than in another. If you can't solve quicksort in ASM, does that mean people would be correct in wanting to refrain you from solving it in Python? It's a bit grotesque but completely analogous to your objection.

It is the opinion of many that cooperative multitasking is not the way to go if you want to solve problems which require massive concurrency.

PS: In Racket, you could defend against threads going into infinite loops with custodians.

http://docs.racket-lang.org/more/#%28part._.Terminating_.Con...

Re:Mistakes Node.js Developers Make by XorNot on Saturday January 03, 2015 @05:47AM (#8830462)
Seriously. Blocking the event loop isn't "an accident that can happen" in node - it's a pretty fundamental mistake.
Re:Mistakes Node.js Developers Make by esailija on Saturday January 03, 2015 @08:20AM (#8830683)
Using any CPU is a fundamental mistake?
Re:Mistakes Node.js Developers Make by nilliams on Saturday January 03, 2015 @01:23PM (#8831501)
People are talking about accidentally blocking the event-loop, e.g. accidentally creating an infinite loop, not 'using any CPU'.
Re:Mistakes Node.js Developers Make by MichaelGG on Saturday January 03, 2015 @09:48AM (#8830826)
Except they don't have the normal option available to them that event loop systems do: start another thread.