apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neil Conway <...@cs.berkeley.edu>
Subject [PATCH] implement pollcb_wakeup()
Date Fri, 08 Jan 2010 21:51:07 GMT
The attached patch against trunk makes the following changes:

* Add apr_pollcb_wakeup(), with similar behavior to
apr_pollset_wakeup(). Along the way, refactor the code for
creating/managing the wakeup pipe to a separate file, wakeup.c

* Add apr_pollcb_method_name(), with similar behavior to
apr_pollset_method_name()

* Add minimal unit tests for apr_pollset_wakeup() and apr_pollcb_wakeup()

apr_pollcb_wakeup() is supported with all the poll methods supported
by pollcb (kqueue, epoll, poll, and event ports).

One behavior of note: if pollcb_poll() observes activity on both the
wakeup pipe and some other descriptors, what is the desired behavior?
The current patch just immediately drains the wakeup pipe and returns
APR_EINTR to the caller; callbacks will only be invoked on any
descriptors that happened to precede the wakeup pipe. That seems fine,
because the user might want to be notified promptly about the
wakeup(); any descriptors that weren't serviced with a callback will
be returned by the next pollcb_poll() call. However, let me know if
this behavior seems wrong -- there are a few other alternatives (e.g.
check for wakeup pipe activity before invoking normal callbacks, or
invoke all normal callbacks before returning APR_EINTR).

Let me know if you'd prefer this patch broken into smaller pieces of
functionality. Note also that it probably conflicts with my earlier
patch for APR_POLLSET_WAKEUP + APR_POLLSET_NOCOPY; I'll submit a
refreshed patch when/if the earlier patch is applied.

Neil

Mime
View raw message