• Post Reply Bookmark Topic Watch Topic
  • New Topic

Whiz Labs Quesion

 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q: Which of the following is the simplest way of making a servlet thread safe.

Options:
a. Implement SingleThreadModel
b. Implement ThreadSafeModel
c. By maintaining a pool of servlets.
d. None of above.
Whiz labs answer: A.
My answer D. Making the servlet implement SingleThreadModel does protect servlet instance variables but what about Servlet Class variables. Hence my answer was D.
Please clarify. Can we expect such questions for exam.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you are correct
 
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!