[Xcb] Doubled API size (was: xcb-util: ewmh library)

Carsten Meier cm at trexity.de
Fri Dec 4 03:24:41 PST 2009


Am Thu, 3 Dec 2009 10:58:25 -0800
schrieb Jamey Sharp <jamey at minilop.net>:

> 
> You can already avoid waiting for the network, if you do some
> book-keeping: Whenever the application waits for a reply or receives
> an event, force xcb_wait_for_reply on all earlier cookies. You know
> what order you submitted them in, so that's not too hard. If you keep
> your list of unforced cookies where the garbage collector can see it,
> then you don't have to worry about anything being freed too soon.
> 
> Carsten, I bet you can make that work for your auto_ptr too.
> 

I need to discard a cookie in the destructor of my reply_ptr (which is
an auto_ptr just for xcb-replies) if the app hasn't fetched the
reply of the cookie due to an error-condition, state-change or whatever.

I really think there should be something like "discard_cookie",
otherwise the destructor must wait for the reply just to free() it
(without ever needing the actual contents)

This could probably be implemented as a separate thread which gets
launched on such a condition, but something like discard_cookie would
be a much more efficient and less complex solution.

Carsten


More information about the Xcb mailing list