RE: Why use threads ( was: Alan Cox quote?)

David Schwartz
2001-06-20T22:19:17Z

> On Wed, Jun 20, 2001 at 02:01:16PM -0700, David Schwartz wrote:

> > It's very hard to use processes for this purpose. Consider,
> > for example, a
> > web server. You don't want to use one process for each client
> > because that
> > would limit your scalability (16,000 clients would become difficult, and
> > with threads it's trivial). You don't want to use one thread
> > for each client

> How is it trivial? How do you debug a 16,000 thread application?

As I said, you don't want to use one thread for each client. You use, say,
10 threads for the 16,000 clients. That way, if an occasional client
ambushes a thread (say by reading a file off an NFS server or by using some
infrequently used code that was swapped to a busy disk), your server will
keep on humming.

DS