apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <jerenkra...@apache.org>
Subject Re: New apr_poll() implementation was Re: [PATCH] speed up network timeout processing
Date Sat, 06 Jul 2002 19:34:35 GMT
On Sat, Jul 06, 2002 at 12:11:59PM -0700, Ryan Bloom wrote:
> I vote to fix the API so that these kinds of mistakes can't happen in
> the future.  I made a lot of mistakes when I designed APR (even though
> Manoj tried to convince me I was wrong).  One of those mistakes is
> having functions use a single variable for both input and result
> parameters.  I would like to fix that mistake for apr_poll now, as long
> as we are changing the implementation.

I don't think that was a mistake.  You are adding extra parameters
where it just confuses the API.  I see no problem with using the
same parameter on input/output - provided that it has the same
meaning on input and output (same as apr_file_read()).

And, it does here, as on input, *nsds is the number of fds to
poll and, on output, *nsds is the number of fds polled.  The
typical Unix convention is to return the *nsds as the output of
the function, but APR has explicit error codes, so we can't do
that.  I don't see a problem with the API and I'm not convinced
that we should change it.

Regardless, why don't we just fix apr_poll() and then discuss
whether we should change/fix the API?  -- justin

View raw message