Proposed rearrangement of wl_event_loop_dispatch

Bill Spitzak spitzak at gmail.com
Mon Jul 9 11:06:39 PDT 2012


Any comments on this?

On 06/27/2012 09:47 PM, Bill Spitzak wrote:
> If dispatch_idle_sources() has a side effect of reading from one of the
> epoll fd's it can cause the fd to become un-ready yet there are still
> events in the internal queue.
>
> This patch moves the (possibly mis-named) post_dispatch_check functions
> so that they are run after the dispatch_idle_sources. These functions
> are used by compositor-x11 and xwayland to read the internal xcb event
> queue. I found this trying to locate why compositor-x11 is so slow for
> me, this does not fix this but I strongly suspect this patch is going to
> be needed in some cases.
>
> Since the post_dispatch_check functions are actually being used as a
> pre-epoll test I think they should be renamed, and possibly just
> installed as a modification of the epoll setup calls (in both cases the
> same callback is done, just with different bits set in the mask). There
> is no need for a true post-dispatch call, since wl_event_loop_dispatch
> is called repeatedly, so any such code can be put into
> dispatch_idle_sources. But making the idle callbacks return > 0 to
> indicate that they should be repeated may be a good idea.
>



More information about the wayland-devel mailing list