What most people miss is that the fastest way to do N short,
nonblocking tasks is to do them one at a time in order. Not quite as
cool as getting to play with a thread library, but still true. Threads
are only an advantage if they allow things to proceed while one task is
forced to "wait" for something. If that never happens, trheads are unot
much help. Wanting 1000 threads means you really think you have 1000
things to do, of which only a few can proceed at any one time. In reality,
that never happens.
Actually, if someone put a gun to my head and forced me to write a
threaded IRC server, I'd have threads serve *channels*, not
connections, and all but the highest volume channels would share
threads. The reason is that connections interact quite often, leading
to hairy synchronization issues (if they don't interact, IRC is pretty
boring :-)) while channels are to a first approximation independent.
---------------------------------------------------------------------------
Tim Hollebeek | Disclaimer :=> Everything above is a true statement,
Electron Psychologist | for sufficiently false values of true.
Princeton University | email: tim@wfn-shop.princeton.edu
----------------------| http://wfn-shop.princeton.edu/~tim (NEW! IMPROVED!)