Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes Threads & Instances Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Threads & Instances" Watch "Threads & Instances" New topic
Author

Threads & Instances

varun bihani
Ranch Hand

Joined: Aug 11, 2003
Posts: 96
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).


<a href="http://www.galaxyweblinks.com" target="_blank" rel="nofollow">www.galaxyweblinks.com</a><br /><a href="http://www.freechatcode.com" target="_blank" rel="nofollow">www.freechatcode.com</a><br /><a href="http://www.onlinefamilytreemaker.com" target="_blank" rel="nofollow">www.onlinefamilytreemaker.com</a>
Idly Vada
Ranch Hand

Joined: Sep 02, 2003
Posts: 135
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Threads & Instances
 
Similar Threads
NX: static RandomAccessFile?
Thread B has to start after completion of 5 instances of Thread A
when not to use thread
NX:(contractor)multi-threads functionally
Why would the container create more instances of the same MDB