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.
Alan