Mark Thomas schrieb am 29.11.2010 um 16:34 (+0000): > On 29/11/2010 16:23, sol myr wrote: > > I've just started looking into the NIO Connector. > > And I see why it's great to combine NIO+Comet... > > But does it makes any difference outside of Comet? > > Yes. > > > 1) Namely, if I only have old-fashioned Servlets (not a > > "CometProcessor") - will it improve performance to use > > NIO connector (versus the good old HTTP connector)? > > That depends on how you define performance. > > > I ran a test with such old-fashioned Servlet, and got > > the impression that Tomcat opens a thread-per-request. > > So it didn't take advantage of the "non blocking" > > feature of NIO. > > Thread per request - yes (it has to due to how the servlet > API is defined) but not a thread per connection. That is a > big difference.
I'd like to understand this non-blocking IO thing. Given Sol Myr's example, can we say that: (a) blocking IO requires one thread (or, in some other server environments, one process) per socket, so the OS gets to switch between processes or threads a lot since they're likely to be waiting on IO; whereas (b) non-blocking IO allows a thread or process to switch between sockets, thus providing scheduling and concurrency on just another level, possibly with advantages? Thanks for your comments. -- Michael Ludwig --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org