title: How exactly does Tomcat's Threadpool work
body: <p>So here's my understanding.</p>
  
  <p>The Apache Tomcat's threadpool (is it called the connector Threadpool? ) has a number of threads ( 200 by default ). Now this means that at a particular time, 200 people can communicate with my web application. </p>
  
  <p>Now, taking a scenario when a particular connects with my application. I get a request, and the tomcat client on the server checks if there is any thread available to cater to the request or not. If it is then good, else we give back some error code. Now in case of success, will that one thread, that I have assigned to that request, be associated with that particular client till the time his request is not handled? </p>
  
  <p>Basically, as a user if I go to, <code>www.myApp.com</code>, I get one thread from the thread pool that fetches all the info from the server and gives me back the final html. After that the thread is free and goes back to pool. Now if I click on something else then again go to the threadpool and get assigned a thread if available and it goes on a on. Is this how it works?</p>
  
  <p>Question 2</p>
  
  <p>Let's say, I have a Java Application on my server side. So when I hit a url, it takes me to some java code. Now is it that, the thread that I got from Tomcat Threadpool, that thread will execute my code?</p>
  
  <p>If that is so, what happens if I make new threads in my java code, will those threads be taken from the Tomcat's threadpool or will those be from the Java's threadpool created? Also, what happens to the execution of the Tomcat's thread in that case?</p>
  
  <p>Thanks.</p>
  
  <p>Kindly provide some Tomcat official references/resources where I can read about such things if you know about any. Cheers.</p>