Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!clyde.concordia.ca!nstn.ns.ca!news.cs.indiana.edu!sdd.hp.com!usc!snorkelwacker.mit.edu!bloom-beacon!dont-send-mail-to-path-lines From: ekberg@asl.dl.nec.COM (Tom Ekberg) Newsgroups: comp.windows.x Subject: Re: resource ID allocation Message-ID: <9102141652.AA06583@asl.dl.nec.com> Date: 14 Feb 91 16:52:49 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 43 > Since there were no replies, I figure nobody knows. I checked Xlib and > could find nothing that does such a thing. I also discovered that there > is no mechanism for setting your own ID when making a request to create > a resource. The client just keeps sucking up valid ID's until there are > none left and them is completely helpless... If I am wrong about this, > please, PLEASE, somebody tell me before my next free Friday night, or > I might just create a support library to handle this. > > BTW: How does one go about suggesting to the powers that be that this > might be a good addition to Xlib. [for ex. XReCreateWindow(Display *, XID)] Sorry I wasn't on xpert when you sent your original message. As a former server implementer, I know that the number of bits available to a particular client are server-dependant. During connection setup, the server tells the client how many bits are available (see page 101 of the X11R4 protocol specification) as well as other server specific information. On the MIT sample server running on a Sun, I see 22 bits for each client. If the client allocates 1 resource every second, it will run out of resource bits in 48.6 days. I suppose you could create a specific server to give you more bits, to work around the problem. The following table, shows that 25 bits should be enough, but you will only be able to have at most 128 clients. Power 2**Power Num clients sec/day Days Years 22 4194304 1024 86400.00 48.55 0.1329 23 8388608 512 97.09 0.2658 24 16777216 256 194.18 0.5316 25 33554432 128 388.36 1.0633 26 67108864 64 776.72 2.1266 27 134217728 32 1553.45 4.2531 28 268435456 16 3106.89 8.5062 29 536870912 8 6213.78 17.0124 30 1073741824 4 12427.57 34.0248 31 2147483648 2 24855.13 68.0497 A better solution would be to have more smarts in the server to allocate resource ids better. A simple approach would be to have a bitmap which indicates the allocated/free state of each resource. With a 22 bit resource id, this would be 512k bytes for each client. The idea is that a long-running client would request this feature so the server would need this table only for certain clients. -- tom, ekberg@aslss02.asl.dl.nec.com (x3503)