tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leon Rosenberg" <>
Subject Re: Blocking threads in Tomcat
Date Tue, 01 Jul 2008 06:46:03 GMT
Hello Frederic,

unless you are using the SingleThreaded Model (and you shouldn't)
tomcat does no such thing.
I assume the best way is to show us your servlet code, or to check for
synchronized blocks in it.


On Tue, Jul 1, 2008 at 6:11 AM, Fredrik Tolf <> wrote:
> Hi list!
> I've had some issues with requests not being carried out in parallel by
> Tomcat. My problem is that I haven't been able to figure out when a
> worker thread blocks and when it does not.
> To try and pin down the behavior, I did a little experiment. I took a
> servlet that I had, that handles to separate URLs; let's call them "/a"
> and "/b". To try out the parallelism, I added a little delay in the
> servlet code by calling Thread.sleep(10000). I then tried them out in
> two browser tabs, and I find the results much enigmatic.
> When I try to access "/a" in one tab and "/b" in another, they both load
> in 10 seconds each -- that is, if I start the request for "/a" at
> 12:00:10 and the request for "/b" at 12:00:15, the request for "/a" will
> finish at 12:00:20, and the request for "/b" will finish at 12:00:25. As
> one would expect.
> However, when I request "/a" in both tabs, the requests seem to be
> carried out in sequence -- that is, if I again st´╗┐art the request in tab
> 1 for "/a" at 12:00:10 and the request for in tab 2 for, also for "/a",
> at 12:00:15, the request for tab 1 will finish at 12:00:20, and the
> request for tab 2 will finish at 12:00:30.
> Why is this? Is Tomcat explicitly not handling two requests for the
> exact same URL in parallel? It is the only explanation I can think of,
> but I cannot figure out how or why it would make sense. If it is indeed
> the case, can I somehow tell Tomcat to not do that?
> Thanks for your attention!
> Fredrik Tolf
> ---------------------------------------------------------------------
> To start a new topic, e-mail:
> To unsubscribe, e-mail:
> For additional commands, e-mail:
View raw message