[GRASS-dev] Re: what if: a new GRASS directory layout?
Glynn Clements
glynn at gclements.plus.com
Tue Apr 8 12:59:04 EDT 2008
Ivan Shmakov wrote:
> > Full transaction support would be nice, but I don't know if it's
> > worth the substantial effort involved in implementing it.
>
> BTW, what do you mean by full transaction support here?
Actually, I was referring specifically to atomicity, i.e. being able
to replace a single map atomically, with no interval where the map
doesn't exist or is in an inconsistent state.
I suppose that there are cases where it might be useful to be able to
update multiple maps atomically, but that's even more work (you would
need an inventory for the entire mapset, not just for indivdual maps).
> > In any case, all of these mechanisms would require substantial
> > changes to a large number of modules.
>
> I'll try to check whether I could make the new layout available
> under the old API as well.
The main problem is that a module reads a map via several calls. All
of those calls must see the same map.
I initially thought that you would need some form of locking, to
prevent the map from being replaced in the middle of the sequence.
However, you could achieve the same result by caching the inventory
within the module, but the code which garbage-collects unreferenced
elements would need to allow for this.
Even there, you could run into problems where a module invokes another
module; the child would need to use the same version of the map as the
parent.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list