The core Xlib XID allocator - Xwindows

This is a discussion on The core Xlib XID allocator - Xwindows ; I was wondering if the Xlib rewrite that IIRC the X.org people are working on will fix the XID allocator bugs. The problem is that right now if you don't use the Display internals, and override the XID allocator associated ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: The core Xlib XID allocator

  1. The core Xlib XID allocator

    I was wondering if the Xlib rewrite that IIRC the X.org people are
    working on will fix the XID allocator bugs.

    The problem is that right now if you don't use the Display internals,
    and override the XID allocator associated with each Display structure,
    the code eventually hits this in libX11 (_XAllocID()):
    if (id != 0x10000000) {
    (void) fprintf(stderr,
    "Xlib: resource ID allocation space
    exhausted!\n");
    id = 0x10000000;
    dpy->resource_id = id >> dpy->resource_shift;
    }


    So, if you have an application running for weeks or months that
    allocates XIDs over a period of time, for GCs, Pixmaps, etc.
    you will eventually hit that, unless you carefully replace the core
    allocator for each Display, and reuse ids.

    Is there a workable solution for replacing this XID allocator pattern?

    Tk for instance has had code to work around this libX11 problem for
    years. Note the: #define XLIB_ILLEGAL_ACCESS 1 is used to access the
    Display internals of Xlib.h:
    http://tktoolkit.cvs.sourceforge.net...10&view=markup

    This is one reason to not use toolkits like Gtk+ (Gdk implements the X11
    bits) and probably others. AFAIK they don't reuse XIDs, so applications
    that run a long time crash eventually. I ran into this problem with a
    Gtk+ app years ago, and from what I've read of Gdk as recently as a year
    ago it doesn't reuse XIDs.

    Do you know if the X.org developers plan to fix this?


    Thanks,

    George

  2. Re: The core Xlib XID allocator

    George Peter Staplin writes in comp.windows.x:
    |I was wondering if the Xlib rewrite that IIRC the X.org people are
    |working on will fix the XID allocator bugs.

    There is no Xlib rewrite being worked on. There is a new library
    written to be used instead - xcb - for which you can ask questions
    like this on their mailing list - see http://xcb.freedesktop.org/

    |The problem is that right now if you don't use the Display internals,
    |and override the XID allocator associated with each Display structure,

    Why would you do that?

    |Do you know if the X.org developers plan to fix this?

    If you want to ask the X.Org developers questions, you'll find dozens
    more of them on xorg@lists.freedesktop.org than on Usenet.

    --
    Alan Coopersmith * alanc@alum.calberkeley.org * Alan.Coopersmith@Sun.COM
    http://blogs.sun.com/alanc/ * http://people.freedesktop.org/~alanc/
    http://del.icio.us/alanc/ * http://www.csua.berkeley.edu/~alanc/
    Working for, but definitely not speaking for, Sun Microsystems, Inc.

  3. Re: The core Xlib XID allocator

    Alan Coopersmith wrote:
    > George Peter Staplin writes in comp.windows.x:
    >|I was wondering if the Xlib rewrite that IIRC the X.org people are
    >|working on will fix the XID allocator bugs.
    >
    > There is no Xlib rewrite being worked on. There is a new library
    > written to be used instead - xcb - for which you can ask questions
    > like this on their mailing list - see http://xcb.freedesktop.org/
    >
    >|The problem is that right now if you don't use the Display internals,
    >|and override the XID allocator associated with each Display structure,
    >
    > Why would you do that?


    See my original post. I'm not sure what the purpose is of your message.
    You clearly trimmed too much in your reply.

    >|Do you know if the X.org developers plan to fix this?
    >
    > If you want to ask the X.Org developers questions, you'll find dozens
    > more of them on xorg@lists.freedesktop.org than on Usenet.


    OK


    George

+ Reply to Thread