Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question ID :1000056254950

 
Timber Lee
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question ID :1000056254950
A servlet implements SingleThreadModel interface. The servlet container may run multiple threads on its methods.
the answe is false.I think the container can create instance for the servlet, maybe, there are multiple threads on the methods of different instance. please correct me!
 
Sonal Magapu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree the answer is false. One cannot create threads for the methods on servlets that implement single thread model
 
Barry Kushnir
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question is a little vague. A servlet container can create multiple instances for a servlet that imlpements the SingleThreadModel, OR the container may create just one instance, and sychronize access to the servlets service method.
If the service method is synchronized, The servlet container may run multiple threads on its methods, but only one at a time in a queued fashion.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!