On Tuesday 14 September 2004 09:35, [EMAIL PROTECTED] wrote:
> Now you say that the benefit of using select is to cut-down the
> number of threads/processes -
> what do you expect to gain from this? Reduce memory use?

Reduced overhead. The overhead of context switching between multiple 
threads, especially in Java, is quite large. multiply that by several 
thousands connections and you can grind any machine to a halt.

I have programmed an HTTP client in Java - it replaced a system that 
used a single thread for each HTTP call (using Java's HTTP connector, 
but I doubt other implementation would prove much better) with an 
implementation built from scratch to use simple non-blocking 
SocketChannels (not selectable channels. I might have got a few more 
bits of performance out of using selectable channels). When the system 
scaled to several hundreds (not thousands) concurrent HTTP calls, the 
performance of the single threaded approach proved to at least an order 
of magnitude better.

-- 
Oded

::..
All generalizations are false, including this one.

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to