Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

IBM 158 question ???

Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer of the question below is d. Could anybody tell me why?
Thanks in advance.
A Servlet must perform 3 operations that are independent of one another. They are time consuming with each operation consuming about 10
msec of CPU. The Servlet's response depends on the completion of all three operations. The developer decides to perform each operation
on a separate worker thread to run them concurrently. Which of the following describe important parts of this implementation?

a) The Servlet should implement MultiThreadModel.
b) The Servlet should implement SingleThreadModel.
c) Access to the HttpSession must be synchronized.
d) The worker threads must not write to the ServletOutputStream.
e) The worker threads must not read from the ServletInputStream.
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
d) would mean that each concurrent thread would write to the ServletOutputStream. I haven't tried, but I am quite sure that this does not work. 3 concurrent threads for one outputstream. Nope.
Some relationship to more common phenomen that you can't use sendRedirect if ServletOutputStream is commited.
a) does not exist.
b) has nothing to do with question. SingleThreadModel is about creating different ServletInstances per request. This question is about parallel use of ServletOutputStream in one request.
c) Session not mentioned in questioned.
e) why not? see no problem.
I would call this a tricky question.
[ March 05, 2003: Message edited by: Axel Janssen ]
today's feeble attempt to support the empire
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!