4 ms·
> The downside of that is that at any given time Tornado can process only one HTTP request. If that processing takes a long time, it blocks all other requests.
by jeremyjh 14y ago
> The downside of that is that at any given time Tornado can process only one HTTP request. If that processing takes a long time, it blocks all other requests.
What? The whole point of an async framework is to service multiple HTTP requests concurrently.
- smilliken 14y agoYes, concurrently, but not necessarily in parallel [1]. Here's an example of what the author meant: while (True); Executing this within a request will block all other requests in a single-threaded web server. [1] http://stackoverflow.com/questions/1897993/difference-between-concurrent-programming-and-parallel-programming http://stackoverflow.com/questions/1897993/difference-betwee...
- jeremyjh 14y agoThe author is talking about concurrency, and so am I. Why the downvote? That quote comes from his paragraph headed "Concurrency". It also refers directly to concurrent HTTP requests. Well, a single Tornado or Node.js process can generally handle many thousands of concurrent HTTP requests if they are implemented correctly without blocking on I/O.
- spankalee 14y agoBut even if the request handlers don't perform blocking I/O, the interpreter is still single threaded, so any computation the handler does blocks all other handlers - only one runs at a time. "Concurrency" in the context of node.js usually is referring to simultaneous connections, not parallel handling of the connections.