[comp.windows.x] Pixmaps & RTD

stripes@MORDOR.ENG.UMD.EDU (Joshua Osborne) (08/26/89)

I am working on a program that has several display connections and trys to
update them 10 times a second, as well as be ready for input from all of them
and to accept new connections at any time.  Currently when a new connection
is made there is a noticable pause (perhaps a second) when a new connection
is made.  I am trying to reduce this pause.  The only X things that are done
to init a connection are: XOpenDisplay() XCreateWindow(), and a whole mess of
Pixmap creations.  (there may be some querys to the resource database as well,
but they can be removed)  There are currently about 90 Pixmaps created, soon
there will be about 300.  These are small (mostly 16x16) pixmaps.  I know
that XOpenDisplay and the database quereys require a round-trip, but pixmaps do
only if Xlib runs out of pre-allocated resource identifyers.  I suspect that
most of the delay is due to me useing up all of Xlibs cached resource ids, and
forceing it to make a request requireing a RTD.  When does Xlib aquire new ids?
Is it after it runs out, or does it ask when it has only N ids left, or some
other time?  I would like to create as may pixmaps as possable, go back to 
processing events from the other connections for a while, then request some
more pixmaps, etc.  Is there a portable way to decide how many pixmaps to
request?  Or at least a resanable number (i.e. the number I could get on
MIT baised servers & Xlibs)?  For local connections on a Eathernet how long
should I wait for the id cache to fill?  Is a tenth of a second long enough?
What about a campus WAN?

Please send replys directly to me because I only read this news group when I
can get a high speed terminal  :-)     I  will sumrise replys to the net.
TIA!

Oh, and please reply to stripes@wam.umd.edu, anything going to
stripes@eng.umd.edu may be unread quite some time!
-- 
           stripes@wam.umd.edu          "Security for Unix is like
      Josh_Osborne@Real_World,The          Mutitasking for MS-DOS"
      "The dyslexic porgramer"                  - Kevin Lockwood
Einstein argued that there must be simplified explanations of nature, because
God is not capricious or arbitrary.  No such faith comforts the software
engineer.
- Fred Brooks, Jr.

rws@EXPO.LCS.MIT.EDU (Bob Scheifler) (08/28/89)

    I suspect that most of the delay is due to me useing up all of Xlibs cached
    resource ids, and forceing it to make a request requireing a RTD.

Nope.  A client gets its entire allocation space at connection setup, Xlib
never needs to request additional allocation.  You'll have to look elsewhere
for an explanation.