[GRASS5] 5.7: XDRIVER modification - CPU load
Markus Neteler
neteler at itc.it
Wed Mar 24 09:34:32 EST 2004
On Thu, Mar 18, 2004 at 06:08:54PM +0000, Glynn Clements wrote:
>
> Markus Neteler wrote:
>
> > > The XDRIVER should consume less CPU now when querying maps or
> > > zooming into. I have added a nanosleep of 500 milliseconds.
> > > We have to experiment with this value to find a good one
> > > with respect to CPU power, operating system and sleepyness
> > > of d.what.vect/d.zoom.
> > >
> > > Let me know. The modified file is indicated below.
> >
> > Mhh. I just realized that the change is nice for d.what.vect,
> > but makes d.zoom extremely slow. Suggestions welcome.
For now I have reverted the change.
> FWIW (and I accept that's probably next to nothing) I would suggest
> either:
>
> 1. Reverting the Get_location_with_* functions to the 5.3 versions,
> and just accepting their limitations.
>
> 2. Getting rid of the Get_location_with_* functions altogether, making
> the "display" API into a *display* API. Use a GUI toolkit if you want
> interaction. [If you got rid of the resize handling at the same time,
> the driver architecture (not just XDRIVER) would become vastly
> simpler, as you wouldn't need to handle X events *at all*.]
>
> In any case, a busy-wait (repeated non-blocking calls in a loop)
> definitely isn't the solution. The only sensible approach is to use
> select() on both the X descriptor and the driver socket. Get_Xevent()
> already does this; I suggest using it; like 5.0/5.3 do.
Using select() and friends seems to be the (temporal) solution unless
someone writes a new display driver. Unfortunatelty I don't know
how to change that. The reasons why select() etc are not used
I cannot remember (if it was ever posted).
Markus
--
Markus Neteler <neteler itc it> http://mpa.itc.it
ITC-irst - Centro per la Ricerca Scientifica e Tecnologica
MPBA - Predictive Models for Biol. & Environ. Data Analysis
Via Sommarive, 18 - 38050 Povo (Trento), Italy
More information about the grass-dev
mailing list