Re: InfoWorld web server shootout

Alan Cox (
Thu, 10 Jul 1997 08:20:19 +0100 (BST)

> > Easy, when one thread hangs on the missing page another thread, presumably
> > doing something else, can continue.
> This assumes that other threads do something with different region of
> memory, and this is what is mostly avoided in one-loop applications.
> Multiple processes handle that kind of situation better because they don't
> have any syncronization that may cause overhead in threads.

Statistically speaking the odds are very much against both threads faulting
at the same time.

> On different procesors? I understand that threads context switch takes
> less time, but that also requires additional processing for
> syncronization. With SMP there will be less context switches, so advantage
> will decrease while overhead remains the same.

With SMP your "single looping task" model should indeed be one task per
CPU, seeking to have each CPU running one task and never switching

> INADDR_ANY), and it's possible to do use multiple accept()'ing threads on
> one port if they are syncronized to avoid simultaneous accept()'s. But

You can do the simultaneously. Linux, BSD and everything else except for
some buggy code (Linux 1.0, Solaris 2.4) handle that happily.