Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Configuring a separate threadpool for async execution


I'm using embedded Jetty in my application and have a few servlets which I want configured to process requests asynchronously. I'm using the simplest way of doing this ( and I do see that the execution of the servlet prior to httpServletRequest.startAsync() is processed in thread 'A' and the async processing happens as part of thread 'B'

However, I notice that threads A and B seem to be coming from the same thread pool (the thread names share the same prefix). From whatever I could find, Jetty, by default, uses only one QueuedThreadPool to process requests and I believe threads A and B are coming from this very threadpool. 

My question is - how is async processing helping in this case where you are taking away another thread from the same thread pool? Is my understanding correct? Is my configuration missing something? Is there a way to configure a thread pool to be used exclusively for async execution so that the container threads accepting HTTP requests can continue to accept requests?

Thanks in advance!

Back to the top