Re: Threads question

Todd Graham Lewis (lists@reflections.eng.mindspring.net)
Fri, 25 Apr 1997 18:42:49 -0400 (EDT)


On Fri, 25 Apr 1997, David S. Miller wrote:

> Still, though, there are legitimate applications wherein having
> multiple thousands of threads necessary. The most active IRC
> server on the net, from what I understand, is a FreeBSD Pentium
> which can accept ~1500 (this is from memory) connections.
>
> Why do you need 1500 threads to service 1500 connections? The answer
> is you don't
(...)
> Perhaps 30 threads or so to get some extra parallelism in there, but
> really not much more before you start hanging yourself.

Sure, it's not an optimal solution, but it's an _easy_ solution. The
thread model of programming makes it much easier, conceptually, to write
your server. You write a generic deal-with-client function, generate one
thread per client, and let the thread library worry about multiplexing
your i/o, etc.

It seems to me that threads can be and are used as a tool to ease program
complexity through these sorts of methods. Maybe I'm not expressing it
well, but I still think there's a case to be made. Then again, maybe I
never took CS 101. 8^)

__
Todd Graham Lewis MindSpring Enterprises tlewis@mindspring.com