Multithreaded servers have their own pitfalls. In my opinion (And this is just me) writing a multithreaded anything introduces a number of complications, and is more difficult than writing asynchronous code.
... for certain types of program. IMHO, if you ever have users interacting with each other in any way, or your problem is IO-bound, or it's CPU-bound but just loops over an array and applies the same computation to each element in said array (async.js makes this easier under node.js), async is much, much easier, and actually easier on the processor as well (in theory). In other cases, multithreaded may be a better choice... but the vast majority of stuff on the web falls into the former section, as it mostly amounts to "contact an external database for data, quickly format, display".
For the record, I don't use node.js myself. I use a tiny, custom web framework written in Python 3, that uses a simple, asynchronous MVC-like pattern.
8
u/cosmo7 Oct 03 '11
But you wouldn't have to do this on other platforms because you're already in a server thread.