[Xcb] Feature Request: Function "xcb_test_for_event"

Bart Massey bart at cs.pdx.edu
Tue Apr 9 10:17:58 PDT 2013


By now, I'm completely lost.

xcb_block_until_event() is called xcb_wait_for_event() as far as I know.
The non-blocking version is xcb_poll_for_event(), but it's almost always a
bad idea to call it.

As Josh suggests, if you want to wait on multiple things at once, spawn a
blocking thread per thing, and demux the result using the usual thread
mechanisms. Pipes are probably overkill here: just use a locked queue. If
you use a semaphore for locking the queue, you can block until something is
in it conveniently.

--Bart


On Tue, Apr 9, 2013 at 1:27 AM, Christian Heller <christian.heller at tuxtax.de
> wrote:

> Hi Josh,
>
> > You don't need to get a character to block on a terminal or serial port.
> > You should just select() or poll() or epoll() or similar on the file
> [..]
>
> Thanks indeed for all those various ideas of yours!
>
> It will take me some time to think them through and adapt CYBOI's
> event handling architecture, for better performance.
>
> > OK, glad to hear that blocking would work for you.
> >
> > Ideally I'd still love to have some way for XCB to just supply a file
> > descriptor you can block on, but I don't know if the structure of the X
> > protocol would reasonably allow that.  Failing that, an
> > xcb_block_until_event or xcb_wait_for_event_noret or similar call seems
> > vaguely reasonable.
>
> Perhaps you could put my email in the corresponding bug/feature request,
> so that I get informed in case such a function gets added?
>
> Thanks again
> Christian
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20130409/a2b55d37/attachment-0001.html>


More information about the Xcb mailing list