[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [apache-plusplus] Process model ideas for C++ Apache.
On Wed, 27 May 1998, Michael Anderson wrote:
> I think I can summarize our differences in perspective, based on
> the type of project and experience. Correct me if I'm wrong ...
>
> Dean Gaudet wrote:
> > What I mean by that is that in general, it is only the
> > kernel that is completely aware of the parallelism available
> > in the hardware.
>
> You would prefer to leave synchronization to the kernel by using
> single fiber start-to-end processing of requests, even though
> that means more threads with the memory burn and cache misses
> that that implies. This applies only to user-level threads
> (fibers) since kernel-level threads also add a context switch
> to each thread's scheduling.
There is an inbetween point. In MxN models which mix user and kernel
threads (such as solaris' pthreads, and NT fibers) it's possible to get
the parallelism of the hardware (user threads alone don't do this), and be
cache friendly. For example, NT's completion ports restart the most
recently blocked thread because it's most likely to still be in the
caches.
There's another point to remember as well. Hardware is cheaper than
labour. When you go beyond the capabilities of a single machine you can
put another beside it. In my experience, web sites grow in this way as a
regular course of events. So if it's easier to program in an implicit
state model then the benefits are greater... and I think it is easier to
program in this model.
Dean