httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@algroup.co.uk>
Subject Memory Hog
Date Sun, 10 Oct 1999 13:24:46 GMT
I've been looking at the implementation of ap_poll() with a view to
moving mpmt_pthread over to using it. Oh dear. Every time poll is
called, a whole pollset is created (and not destroyed). The whole thing
is terribly inefficient, too.

Something needs to be done. I don't really understand why the
ap_pollset_t isn't just a struct pollfd (or a thin wrapper around one).
And why translate between POLLIN and APR_POLLIN et al. instead of just
making them the same? Also, having to scan the whole pollset to find a
particular socket is dreadful (especially since this is going to be used
in a scan through all sockets in the main loop, making it an O(n^2)
process).

Funnily enough, if poll() is emulated with select() the implementation
is far more efficient.

I'd attempt a fix, except the whole reason I'm looking at this is
because I don't have poll().

Cheers,

Ben.

--
http://www.apache-ssl.org/ben.html

"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
     - Indira Gandhi

Mime
View raw message