• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Threads

 
Gunnar Maluf
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all

I know threads from the scjp exam where the code in the run() method runs in a different memory stack. But i am not sure about threads in servlets. I know the container creates one object/instance per servlet but i dont know what would be in the run() method. The whole class?

regards
Gunnar
 
Amit M Tank
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thats upto the container to implement. generally the container have a threadPool (pool of Thread). Whenever a request comes a new Thread is taken from the Thread pool and is associated with the request by the container. In short the run method would somehow call the service method of the servlet(directly or indirectly through layer of abstraction).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic