You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Brian Pane <br...@apache.org> on 2002/08/01 06:06:33 UTC

[PATCH] Re: [Request for comments] new poll API

Here's the code for the general-case poll API.  I've run out
of time for today, so I'm posting this as a patch rather than
committing it, in hopes that someone else may be able to pick
it up tomorrow (I'll be in meetings much of the day).

This code compiles, but it hasn't been tested.

Known problems:
  * It's missing a fallback implementation for systems without poll(2)
  * The "add descriptor" function doesn't check for duplicates.
    I did this on purpose: it's implemented as a simple append
    so that addition runs in O(1) time.  The long-term solution
    is probably to build a balanced tree out of the entries for
    O(log(n)) insertion, deletion, and lookup; but I think the
    current solution is probably good enough for the first release.
    (The original poll API was O(n) for all of these.)
 
Brian

Jeff Trawick wrote:

>Brian Pane <br...@apache.org> writes:
>
>  
>
>>To continue the recent discussions on the problems in the current
>>apr_poll API, here's a patch for apr_poll.h that illustrates my
>>proposed fix.
>>    
>>
>...
>  
>
>>  - A general-purpose poll API for larger sets of descriptors.
>>    This one is an abstract data type, accessible only through
>>    functions, so that we can do internal optimizations in the
>>    future (like replacing poll with /dev/poll on supported
>>    platforms).
>>    
>>
>
>In the interest of making progress I think you need to go ahead with
>this and we can all deal with the details (i.e., stick in the old code
>with new names and other tweaks) over the next couple of days.
>
>  
>