[Xcb] a question about request and reply

Jamey Sharp jamey at minilop.net
Tue Dec 13 11:46:42 PST 2005


On Tue, Dec 13, 2005 at 07:16:45PM +0100, Vincent Torri wrote:
> On Tue, 13 Dec 2005, Barton C Massey wrote:
> > Yes, the reply is currently queued until you force the
> > cookie, so you'll leak memory.  Nothing worse. :-)

If it's still there after about four billion more requests have gone by
then you'll get bad data probably. :-)

> > It seems to me pretty straightforward to add
> > XCBDiscardCookie(GenericCookie) to the interface.
> 
> there is a GenericCookie ? I've only see VoidCookie and all the others
> corresponding to the requests. I think that such a structure should be
> added.

There isn't a GenericCookie, and I don't want to add one. Functions like
XCBWaitForReply just take the 'unsigned int' from inside the cookie
structure. I don't want to encourage casting structures any more than I
have to.

> > Non-blocking, and if called before the reply is delivered
> > simply sets a bit saying the reply should be discarded when
> > it arrives.  Is this something we need/want?
> 
> maybe for the reply code ?

xcb_reply is probably the strongest example of why "DiscardCookie"
functionality is *not* needed: if xcb_reply needs this functionality, it
can set a flag in its own queue and, when the reply arrives, free the
data without invoking the callback.

In other words, this can be built on top of XCB's current interface, so
I'd need to see a very compelling use case to consider adding it to XCB.

--Jamey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20051213/9d0ecaf6/attachment.pgp


More information about the Xcb mailing list