3 ms·
As others here have mentioned, there is no necessary relationship between the awful async syntax so common to JavaScript environments and non-blocking IO. There
by pkghost 12y ago
As others here have mentioned, there is no necessary relationship between the awful async syntax so common to JavaScript environments and non-blocking IO. There are plenty of languages/environments that support highly scalable network operations (that is, do not use a new thread or process to handle each new connection) without introducing callback hell.
The Greenhouse framework in Python is one of them (http://teepark.github.io/greenhouse/master/ http://teepark.github.io/greenhouse/master/). The docs (linked) have a concise discussion of the various approaches to parallelizing IO operations with pros and cons of each, and, for most database applications, an obvious winner.
- zhong-j-yu 12y agoWe can argue that thread sucks because it is expensive. But we must measure how expensive it actually is in real world applications, before abandoning it. If a server must maintain a few hundred concurrent threads, it is really nothing.
- pacala 12y agoTo be precise, threads suck because thread _scheduling_ is expensive. From a logical pov, structured programming still rules, and threads are an excellent way to implement structured programming.