Hi,
-----Original-Nachricht-----
> Von: Mark Haroldson <[email protected]>
> An: <[email protected]>
> Example:
>
> Given the following servlet;
>
>
>
> Servlet()
>
> {
>
> Output("Start thread");
>
> Thread.sleep(20000);
>
> Output("End thread")
>
> }
>
>
>
> I would expect the following output
>
>
>
> Start Thread
>
> Start Thread
>
> Start Thread
>
> Start Thread
>
> End Thread
>
> End Thread
>
> End Thread
>
> End Thread
>
>
>
> Instead I see
>
> Start Thread
>
> Start Thread
>
> End Thread
>
> End Thread
>
> Start Thread
>
> End Thread
>
> Start Thread
>
> End Thread
>
>
>
> What are the factors that control thread concurrency in Tomcat? Has
> anyone seen behavior like this before? Should I expect a high number
> of concurrent threads or does java/tomcat gate access to the servlet?
Are you testing this with a Browser? If so, then I would guess the browser only
uses 1 TCP connection to send all requests. For example, Firefox and Chrome
open only one TCP connection and send the requests sequentially if I open
multiple tabs with the same URL (they wait for the 1st request to finish before
they send the second request). In this case I see an output like this:
Start Thread
End Thread
Start Thread
End Thread
Start Thread
End Thread
However, If I use IE10 on Win8, it will open multiple TCP connections and send
the requests concurrently. The output will look like this:
Start Thread
Start Thread
Start Thread
End Thread
End Thread
End Thread
Regards,
Konstantin Preißer
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]