[Qgis-developer] New API for access to vector features
Martin Dobias
wonder.sk at gmail.com
Mon Jul 5 09:40:04 EDT 2010
On Mon, Jul 5, 2010 at 3:07 PM, Frank Warmerdam <warmerdam at pobox.com> wrote:
> Martin Dobias wrote:
>
>> I was thinking about this. Having the possibility of simultaneous
>> access for all providers would be indeed nice, though I'm not sure how
>> feasible it would be: if the provider's backend has API that is not
>> reentrant (e.g. it uses static variables), there isn't probably much
>> we could do with in, only to use locking. But the good news is that
>> most (if not all) of the current providers could be altered to allow
>> simultaneous access from threads. So far I don't know how this would
>> be handled in grass provider, and maybe there could be problems with
>> some obscure OGR drivers.
>
> Martin,
>
> I failed to follow this thread closely. How would you anticipate
> implementing simultaneous access from multiple threads at all for OGR?
> Currently you can never have multiple active feature iterators operating
> against a particular layer in OGR because the feature iteration is "state"
> of the OGRLayer and there can only be one OGRLayer representing a layer of
> a datasource.
>
> RFC 16 was intended to address this by allowing creation of clone OGRLayer's
> but it was never adopted and implemented.
>
> http://trac.osgeo.org/gdal/wiki/rfc16_ogr_reentrancy
>
> It seems that it isn't just "obscure OGR drivers", but all OGR drivers that
> would fail to meet your desired level of service.
Hi Frank,
from our recent discussion on gdal-dev [1] I've got the impression
that for allowing second or any further iterator (all active at the
same time), the OGR provider could create a clone of its OGRLayer and
thus do each iteration in a separate instance of OGRLayer. By making a
clone of OGRLayer I mean to open a new one with the same input
parameters.
[1] http://lists.osgeo.org/pipermail/gdal-dev/2010-June/025012.html
Regards
Martin
More information about the Qgis-developer
mailing list