switching the server to poll/epoll

Adam Jackson ajax at redhat.com
Tue Jun 14 14:44:18 UTC 2016


On Mon, 2016-06-13 at 14:38 -0700, Keith Packard wrote:
> Adam Jackson <ajax at redhat.com> writes:
> 
> > I'm not convinced of the Xephyr change to drain the event queue in
> > BlockHandler. How exactly would we not get the notify fd callback?
> > Surely if xcb_poll_for_queued_event() finds new events to work on, then
> > the poll() we're about to do would see the fd as readable.
> 
> If something else reads events, such as libGL, then the events will be
> queued inside xcb and not left on the fd. Note that I'm using
> 'xcb_poll_for_queued_event', which only looks for events already read
> From the socket and hence unable to wake up poll.

Okay, that makes sense. I'm still a little wary of it, because I don't
trust myself to remember the BlockHandler wrapping order and therefore
worry that actions triggered in ephyrXcbHandleEvent might not be safe
to do while we're halfway unwound. (eg, would an expose event trigger
some drawing that wouldn't flush through promptly because shadow has
already synced with the screen in its BlockHandler.)

One possibility might be:

    if (xcb_peek_queued_event(conn) != 0)
        AdjustWaitForDelay(timeout, 0);

Except, of course, that xcb doesn't have any API like that. Sigh.

- ajax


More information about the xorg-devel mailing list