XC-MISC / X-Resource / core protocol extension proposal

Adam Jackson ajax at nwnk.net
Mon Feb 9 07:17:15 PST 2009


Can you believe it, I think I actually came up with a useful way to use
the protocol minor number.

The background here is the static client/resource split in the XID
space.  It's never right for anybody.  I've seen bug reports both of
running out of clients and of running out of resources, so clearly you
can't win.  However, for the vast majority of clients, the XID space is
insanely roomy.  On the desktop I'm currently running, metacity holds
the most XIDs by about a factor of two, but even then it's only got 2500
or so.  (Yes, this includes firefox.  I'm as shocked as you are.)

So imagine this.  Change the XID block size to be something much
smaller, say 64k resources per client.  Allocate one block to a client
at connection handshake.  Add a request to XC-MISC that allows the
client to fetch additional blocks, and hook it into the existing XID
allocation code in Xlib.  Obviously you'd then also need to extend
X-Resource to cope with this new allocation scheme.

This new scheme would be protocol version 11.1.  For maximum interop
with 11.0 clients, you'd leave the XID block size as something
reasonably large.  Alternatively you could make it 4k for 11.1 clients
but 256k (or whatever) for 11.0 clients, and allocate them from
alternate ends of the XID space so you don't lose for fragmentation.
But I think I like the single-chunk-size idea better.

I can't think of anything obvious this would break.  There's a minor
concern about what to do about the server's XID space, but (assuming
xrestop isn't lying to me) the server is only holding 67 or so, so
probably one block of whatever size is more than sufficient.  Also, yes,
this would be a fairly invasive change to the server, and possibly to
Xlib, but when has that ever stopped anyone.

Feedback (or implementation!) appreciated.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.x.org/archives/xorg-devel/attachments/20090209/a4de1af6/attachment.pgp 


More information about the xorg-devel mailing list