discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XCB (Was Re: Window managers ( was Re: newbie question ))


From: David Chisnall
Subject: Re: XCB (Was Re: Window managers ( was Re: newbie question ))
Date: Thu, 23 Apr 2009 16:18:28 +0100

Hi Fred,

On 23 Apr 2009, at 16:12, Fred Kiefer wrote:

could you please detail a bit on the benefits of an XCB backend compared to an Xlib one? As you already pointed out newer versions of Xlib are internally able to use XCB, so what can we gain by using it directly?

The big advantages (apart from linking against a much smaller library) are that XCB has a design which is trivial to integrate with a GNUstep runloop (i.e. it provides a file descriptor that you can add to the run loop and receive notifications when there are pending events, which is what I am doing) and that it is much better at latency hiding. A lot of XLib calls attempt to provide a synchronous API on top of an asynchronous protocol, so the client (GNUstep app) is spending time waiting for the round trip to the server. On a local machine this just adds a bit of overhead, but on a remote system even on a local network it is common for the GNUstep app to be spending more than 50% of its time in a blocking state waiting for data from the X server which is not really required immediately. XCB is a pure asynchronous design, using futures, and lets you fire off messages to the X server and not block for receiving the replies until you actually need them.

David




reply via email to

[Prev in Thread] Current Thread [Next in Thread]