Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Threads & Instances

 
varun bihani
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a very general question as i am a neophyte in java.
I want to know what is difference between instances and threads in servlets/jsp.
I want to know how does servlet handled multiple requests(simultaneous).
 
Idly Vada
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you should read about processes and threads.
Sun tutorial at
http://java.sun.com/docs/books/tutorial/essential/threads/
may help you.

If you use SingleThreadModel for a servlet, an instance of servlet is created for each request.
Ohterwise, a new thread is created for each request.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic