| Author |
singlethread model
|
clyde melly
Ranch Hand
Joined: Sep 04, 2003
Posts: 152
|
|
|
if a servlet implements the singlethread model and suppose there are 10 requests,how many instances are created and how does the management for the request proceed.if the single thread model is not implemented then how many instances wud be created for the 10 requests as stated above.
|
 |
unni krishna
Ranch Hand
Joined: Jul 14, 2004
Posts: 39
|
|
*** SingleThreadedModel is depricated. Now a days nobody uses it **** If a servlet implements single threaded model, then one instance of that servlet can serve only one request at a time. The number of instances created can be specified by the user in web.xml. If the servlet does not implement single threaded model, then with single instance, 10 requests can be served.
|
Software Engineer (SCJP)<br />USTechnology, CA
|
 |
clyde melly
Ranch Hand
Joined: Sep 04, 2003
Posts: 152
|
|
|
so for 10 requests 10 instances ??? in which case implementing singlethreadedmodel?
|
 |
unni krishna
Ranch Hand
Joined: Jul 14, 2004
Posts: 39
|
|
|
friend, dont use singlethreaded model. if u implement single threaded model, then the number of requestes that can be served at a time is equal to the number of instances of the servlet that you create.
|
 |
clyde melly
Ranch Hand
Joined: Sep 04, 2003
Posts: 152
|
|
|
i get it but just wanted to know how does the request management happen with both approach in details
|
 |
Peter den Haan
author
Ranch Hand
Joined: Apr 20, 2000
Posts: 3252
|
|
Funny how many of the same people who disparage SingleThreadModel are happy with EJBs Having said that, I would agree: don't use SingleThreadModel (or the JSP equivalent). Write threadsafe code. It's not that hard. - Peter
|
 |
 |
|
|
subject: singlethread model
|
|
|