tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: [GSOC] Filters & Async Support in Servlet 3.0
Date Fri, 03 Apr 2009 11:05:13 GMT
anas Ahmed wrote:
> Hello all,
> As i have  read from Servlet 3.0 specification about filters "A Filter and the target
servlet or resource at the end of the filter chain must execute in the same invocation thread".
> 
> This mean if there are many Async Requests which are connected to filters, many filters
will be init but  not destroyed until response come back or filter work finish.

My understanding is that the filter processing in the outbound direction
will take place after the Servlet completes (without generating a response).

The filters will not have to wait until the Async processing completes.
However, any wrappers they put in place may have to remain until the
async processing completes.

> As we know Tomcat uses thread per request through Java NIO.
Tomcat uses one thread per request for BIO, NIO and APR/native.
The differences are with connections where BIO uses 1 thread per
connection (including those in keep-alive) whereas NIO and APR/native
use polling threads that each maintain a number of connections.

> More simultaneous requests(connected to filters) cause more threads to be consumed,
More concurrent requests does equal more threads but the number of
filters is not a factor.

> which cancels out the benefit of the thread-per-request approach to a high degree.
Given the number of filters is not a factor, I don't think this is the case.

Mark


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


Mime
View raw message