apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Norris <...@cataclysm.cx>
Subject RESEND: PATCH: Update requested events for a descriptor that is already in a poll set
Date Sun, 14 Mar 2004 08:15:53 GMT
[ I'm resending this, because I didn't get any responses to it the first
time. ]

Attached is a patch that adds a function apr_pollset_update(). This
updates the list of requested events for the descriptor in the
underlying implementation for a descriptor that is already in a pollset.

It works well enough, but I'm not happy with it because it requires a
search through the pollset (just as apr_pollset_remove() does). On a
server with hundreds or thousands of descriptors in the set and changing
events often, this might end up being too expensive.

The optimisation that I'd like to do is to maintain a pointer (by index
or explicit) for each descriptor that points to the descriptors'
underlying pollfd structure, and just use this. This would lose the
ability to enter a socket into the set multiple times with different
events, as is currently possible, but would eliminate the search.

The only problem with this is that such a pointer would really belong in
apr_pollfd_t, except that its specific to the poll() implementation, and
that type is not opaque. So I'd appreciate some pointers on how to best
do this.


Robert Norris                                       GPG: 1024D/FC18E6C2
Email+Jabber: rob@cataclysm.cx                Web: http://cataclysm.cx/

View raw message