Wanna guess the worst offending x app I've seen?
(B
(BIt starts with "ja" ends with "va" ... (can you "swing" an answer to this)
(B
(B----- Original Message -----
(BFrom: "Carsten Haitzler (The Rasterman)" <[EMAIL PROTECTED]>
(BTo: <[EMAIL PROTECTED]>
(BCc: <[EMAIL PROTECTED]>
(BSent: Friday, December 17, 2004 6:11 PM
(BSubject: Re: How does XSetInputFocus() generate errors?
(B
(B
(B> On Fri, 17 Dec 2004 17:31:35 -0800 "Robert Currey" <[EMAIL PROTECTED]>
(Bbabbled:
(B>
(B> > > the protocol level you will know just which calls these are. some of
(Bthem:
(B> > > XGetWindowAttributes, XSync, XQueryTree, XGetWindowProperty,
(BXInternAtom,
(B> > > XGetImage.
(B> >
(B> > This is TRUTH ... I had a "debate" one time with someone who claimed X
(Bwas
(B> > asyncronous ... for the protocol, that is true, but using Xlib and with
(Bthe
(B> > cases stated, it is NOT. XGetWindowAttributes is probably the nastiest
(Bof
(B> > the bunch (I've seen apps do XGetWindowAttributes/XSetWindowAttributes
(B> > hundreds of times during startup and/or worse opening a window).
(BXInternAtom
(B> > and XGetWindowProperty are the other most common culprits.
(B>
(B> oh yeah. hell yeah. actually - writing wm's has made me acutely aware of
(Ball of
(B> this. i am going to the extent of trying to remove get property requests
(B> entirely right now by first listing (a round trip unfortunately) then only
(B> fetching the properties that exist (at that time) that i care about (as a
(Bwm),
(B> then relying on property change events to fetch any that get added later.
(Bbut
(B> even this sucks. this is where xcb rules the roost. it talks raw x
(Bprotocol. i
(B> can just send off my property fetch requests (and atom fetches at the
(Bstart) all
(B> nicely batched off and get them back later as asynchronous reply "events".
(Bsince
(B> the hole codebase is entirely event driven this works perfectly within the
(B> existing coding model. BUt the issue here is programmers knowing all this
(Band
(B> spending the time to optimise through it are rare - most think in
(B"get/reply"
(B> scenarios where when the function returns the information has been fetched
(Band
(B> handed back to the app. it takes a bit of mind bending to start thinking
(Bof your
(B> entire app as being asynchronous - even to your display. xlib was written
(Bwith i
(B> guess the assumption that such mental gymnastics are often beyond a lot of
(B> programmers and thus xlib hides it. i do say it is easier to do it that
(Bway too
(B> - until you realise the ugliness of the overhead behind it all and recoil
(Bin
(B> shock. :)
(B>
(B> > One common app would XGetImage the area under the cursor so it could do
(Ba
(B> > pretty "i beam" ... ugggggh
(B>
(B> as long as it queued the get for "idle time" (ie just before it goes back
(Bto a
(B> select() or a blocking wait for events etc.) making sure it didn't do it
(Bfor
(B> every single mouse motion event... this won't be THAT bad... well not on a
(Blocal
(B> machine (network badness will vary on nastiness of the network) :) a few
(Bround
(B> trips per event cycle isn't too bad as new events are buffered/batched and
(Bthen
(B> dealt with in a batch so the app is a bit jerkier but it "plays catch-up"
(Bto the
(B> input stream. unfortunately a lot of software does not do this. they do
(Bwork for
(B> every mouse motion or whatever event. if the expense of dealing with those
(B> events is greater than the time between events... the app is in grave
(Btrouble.
(B> the problem here is... run the app on a slow/old machine and this scenario
(Bis
(B> MUCH more likely... now the app falls increasingly behind "realtime"
(B(where the
(B> user has their mouse now or what events have happened) and this is when
(Bevilness
(B> really shows its head and you notice how poorly programmed that client is.
(B>
(B> > Rob
(B> >
(B> > _______________________________________________
(B> > Devel mailing list
(B> > [EMAIL PROTECTED]
(B> > http://XFree86.Org/mailman/listinfo/devel
(B> >
(B>
(B>
(B> --
(B> ------------- Codito, ergo sum - "I code, therefore I am" --------------
(B> The Rasterman (Carsten Haitzler) [EMAIL PROTECTED]
(B> $BMg9%B?(B [EMAIL PROTECTED]
(B> Tokyo, Japan ($BEl5~(B $BF|K\(B)
(B>
(B
(B_______________________________________________
(BDevel mailing list
([EMAIL PROTECTED]
(Bhttp://XFree86.Org/mailman/listinfo/devel