tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject Re: Tomcat 7, Servlet 3.0, and Non-Blocking
Date Wed, 09 Nov 2011 09:24:57 GMT
Matthew Tyson <matthewcarltyson@gmail.com> wrote:

>I guess what I'm asking is if I just start using the Servlet 3.0
>support
>for suspending requests out of the box, will it be a thread blocking
>implementation I'm using?

That depends what you mean by "thread blocking". Once startAsync has been called the thread
that was processing the request/response is released to handle other requests regardless of
connector.

>HTTP APR/native is blocking as well, correct?

Wrong. You should read the docs, particularly the summary at the bottom of the HTTP connector
configuration page 

>So if I want to use Servlet 3.0 async (eg, a call to
>request.startAsync),
>and have it be handled without blocking IO, I need to use the NIO
>connector?

Wrong again. All Servlet IO is blocking IO. If you look at the API you'll see that all read
and write calls are blocking.

You seem to be mixing up blocking and non-blocking IO with whether or not a thread is dedicated
to processing a request/reponse pair for the life of the request/response. They are very different
beasts.

All connectors release the thread to handle other requests once startAsync has been called.

As an aside, the non-blocking connectors will use non-blocking IO where they can but once
you get to the Servlet API, that is always blocking IO.

Mark




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message