• Post Reply Bookmark Topic Watch Topic
  • New Topic

threads  RSS feed

 
manohar reddy
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If a jsp is marked as �isThreadSafe= true� does that mean

Multiple threads can access the JSP simultaneously

(Or)

Only one thread can access the JSP anytime
 
Olivier Houyoux
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

If you use the single thread model, you will have multiple instances of the servlet loaded and initialized in a pool instead of a single instance of the servlet generated for your JSP page loaded in memory, with the service method of each instance effectively synchronized. You can control the number of instances that are instantiated for all servlets implementing SingleThreadModel through the administration application of your JSP engine.

The SingleThreadModel mechanism works well for low volume sites but does not scale well. If you anticipate the increased number of users, you should implement explicit synchronization for your shared data.

Note that SingleThreadModel is resource intensive. The most serious issue however is when the number of concurrent requests exhausts the number of servlet instances in the pool. In that case, all the unserviced requests are queued up until one servlet becomes free -> poor performance.
[ November 23, 2007: Message edited by: Olivier Houyoux ]
 
Hanuma Deepak Muvvala
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
isThreadSafe = true means Multiple threads can access simultaneously, specifying true means nothing but you are telling the Container that your jsp is thread safe any can acceess at a time. If it is false the the JSP implemets SingleThreadModel interface.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!