apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@everythingsucks.co.uk
Subject Re: UPDATE: [Patch] poll/unix/poll.c:apr_pollset_poll() optimisation
Date Thu, 05 Jan 2006 01:50:24 GMT
Quoting "Roy T. Fielding" <fielding@gbiv.com>:

> On Jan 4, 2006, at 4:42 PM, gerry@everythingsucks.co.uk wrote:
>
>> Quoting Garrett Rooney <rooneg@electricjellyfish.net>:
>>
>>> Um, I don't think that's going to work, rv is the number of
>>> descriptors that hit, there's nothing that says that if N hit  it'll be
>>> the first N...
>>
>> That would be true were I comparing  I<RV but I'm comapring J<RV :D
>
>>>> -    for (i = 0; i < pollset->nelts; i++) {
>>>> +    for (i = 0; j < rv; i++) {
>
> I have a vague recollection that there was some reason we couldn't
> trust the return value being equal to the number of ready descriptors
> on some platform, but I have no time to search the archives for why.
> I may be remembering something related to ... er .. that other call
> like poll... hmmm, oh, select.  Or maybe I just need more caffeine.
>
> ....Roy
>

You are correct, select() returns the total number of descriptors in 
the FDSET rather than those which have had events.

However the patch applies specifically to the poll() implementation for 
pollset, select() remains unchanged for that very reason.




Mime
View raw message