> >Of course there is a tremendous overhead associated with
> >creating new threads
>
> There isn't a "tremendous overhead". There is an overhead but it's
> not tremendous. It also depends on what sort of threading system
> you're using. In general system level threads (like pthreads) will
> take longer to create than green threads (threads "emulated" by the
> JVM).
>
> Still, even in such scenarios it is perfectly feasible to not use
> thread pools... Tomcat doesn't by default I understand.
>
> It's my view that threadpools are fairly easy to setup and therefore
> why not use them? But others don't share that view.
I believe that even if it is not a "tremendous overhead", thread pools are
much more efficient and better way to do things. One can even put in logic
in the thread pool to alert the system adminstrator in case the size of the
thread pool exceeds certain no of threads indicating that either the load is
too much or we have some misbehaved servlets in the container.
In view of this it is astonishing to know that Tomcat does not utilize
thread pools.
Can someone tell us why Tomcat has chosen not to gone in for a thread pool.
> In the GNU-SocketServer (the thread pool used in Paperclips) this
> will cause new threads to be created to take over from the blocked
> one... but then the same servlet could get requested again and block
> another thread, causing another increase.
>
> So in the end you end up with a system that is penned in by the
> maximum number of threads a single JVM can create.
So once again it is up to the servlet writers to write appropriate code and
not the responsibility of the framework to ensure that what they code is up
to the mark!!
> The same is true of the non-pooled system, creating a thread per
> request.
What happens here if the load is high? ill high load not lead to a large no.
of threads? In a thread pool based system we may go in for some sort of
queing of the requests to keep the nos. of threads within a certain limit.
>
> Nic
>
Regds,
Gokul
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html