About Question com.enthuware.ets.scwcd.v5.2.116 :

Moderator: admin

Post Reply
ETS User

About Question com.enthuware.ets.scwcd.v5.2.116 :

Post by ETS User »

Assuming that the Servlet Container has just called the destroy() method of a servlet instance, which of the following statements are correct?
options -
4>There are no container threads running over this instance's service method.

5>All threads created by this servlet are done.

What is the difference between above two options? Option 4 is marked as correct answer whereas option 5 is not.

admin
Site Admin
Posts: 10384
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question com.enthuware.ets.scwcd.v5.2.116 :

Post by admin »

The difference is that a container has no knowledge of the threads that are created by the servlet code, so it cannot guarantee that those threads are done. It is not recommended for a servlet to create its own threads in such manner for the same reason.

Threads created by the container and managed by the container itself. Hence, it known if there is any container created thread is still in the middle of executing the service method. Therefore, the servlet will not be destroyed until such thread is finished processing the service method.

HTH,
Paul.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest