• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

singlethread model

 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
*** 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.
 
clyde melly
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so for 10 requests 10 instances ??? in which case implementing singlethreadedmodel?
 
unni krishna
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i get it but just wanted to know how does the request management happen with both approach in details
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
knowledge is the difference between drudgery and strategic action -- tiny ad
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic