httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manoj Kasichainula <>
Subject Re: cvs commit: apache-2.0/mpm/src/modules/mpm/mpmt_pthread mpmt_pthread.h Makefile.tmpl acceptlock.c acceptlock.h http_accept.c mpmt_pthread.c scoreboard.c
Date Mon, 28 Jun 1999 19:20:19 GMT
On Mon, Jun 28, 1999 at 09:16:05AM -0700, Dean Gaudet wrote:
> BTW manoj, in 1.3, the complex "ring of listeners", and "last_lr" stuff is
> mostly for the prefork model I think.  I'm not sure you need it for your
> stuff, you'll have to be the judge.
> The problem I was avoiding was starvation of any single socket... which
> can easily happen in the prefork model.  Whereas in some threaded models
> you're going to scan the entire list of sockets each time select/poll
> returns... which is another way to ensure fairness. 

The model in this MPM is almost the same as the prefork MPM, except
that we have multiple threads per process doing the work instead of
one. The problem with just scanning the whole array every time is that
we never know if another thread has handled the connection or not, and
I'd rather not introduce the serialization needed to ensure that we
can find out.

Hmmm, but, we could just scan the pollfd array like we scan the
listener linked list, and save the last index checked. In fact, this
would work for the prefork model (which uses select instead of poll)
too, right?

BTW, I tried switching the listener linked list stuff in the pthread
MPM to match that from the current prefork MPM, and it didn't work. I
think there's a logic error in the prefork's version, but I played
with so many different permutations of the logic that I don't remember
what the specific problem was.

Manoj Kasichainula - manojk at io dot com -
"Yes, I'm Linus, and I'm your God" -- Linus Torvalds, Linux Expo '98

View raw message