>>> Gokul Singh <[EMAIL PROTECTED]> 06-Nov-00 11:01:52 AM >>>
>> 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?
Threads are quite lightweight objects (even when they're implemented
as system level threads) and so it is possible to handle quoite large
loads without pools.
The big problem with non-pooled systems is the possible load on the
garbage collector. GCs are not yet sophistcated enough IMHO and
anything one can do to reduce the load caused by GCs is a good
thing.
One day (and soon I imagine) thread pools will be made irrelevant by
better thread implementations. For example something we have talked
about with Kaffe is the VM providing a green threads implementation
that used an internal pool of established pthreads. Since green
threads are very fast to create it might be okay to do without them.
With a GC targetted specifically at cleaning up thread objects as soon
as they were out of scope this might make the need for a thread pool
completly redundant.
Some of these things need to be investigated... you have to rememeber
that the Java is having a big impact on how we think about VMs and
programing in general.
>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.
You can do that in a thread creation system too...
The only real concrete advantage of the thread pool system is the
re-use of the thread objects which otherwise have to be GCed.
One balances this against the fact that you have to extra "thread"
things like wait and signal threads and pass Sockets over queues.
It's a delicate balance.
Nic
___________________________________________________________________________
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