by LewisJEllis · 11y ago · 0 comments
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.
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...