[GRASS5] Region lock

Glynn Clements glynn at gclements.plus.com
Sat Dec 4 15:31:25 EST 2004


Radim Blazek wrote:

> >>Does it make sense to add region lock?
> > 
> > 
> > AFAICT, no.
> > 
> > Is there a specific scenario where you think that a lock would be
> > useful?
> 
> Always when user run a raster module via GUI or on background and then 
> he continues to change the region g.region/d.zoom. It is quite common, 
> if user has to wait until the background job finishes he usually query 
> maps in monitor using d.zoom/d.pan. This is especially danger for scripts.
> No errors are reported, but results are wrong (e.g. r.what in loop).

Right. But I don't think that this can be fixed with a generic
mechanism.

The problem is that the top-level (e.g. the program which repeatedly
runs r.what) must hold the lock, not the lower-level program (e.g. 
r.what).

> I cannot say how danger it is for single modules. For scripts it IS 
> problem. We could add g.regionlock and encourage users to start scripts
> with this module.

Right. It's only likely to be an issue for scripts and programs which
spawn other programs where the region is required to remain constant
for multiple related processes. Normal programs read the WIND file
once then use that data for their duration.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list