[Gdal-dev] Motion to Adopt RFC 16: OGR Thread Safety
Simon Perkins
sy at perkins.net
Sat Oct 6 14:17:06 EDT 2007
> What about methods that modify a layer? i.e. we have two threads, A and
> B accessing the same layer via layer clones, so they each have their own
> read state. What if thread A checks to see if a feature with FID 42
> exists, then B invokes a method to delete feature 42, before thread B
> attempts to get the geometry for that feature? Even if those calls are
> serialized, it is likely that thread A will get very confused.
>
Doh! Managed to screw up my example... This should read:
"What about methods that modify a layer? i.e. we have two threads, A and
B accessing the same layer via layer clones, so they each have their own
read state. What if thread A checks to see if a feature with FID 42
exists, then B invokes a method to delete feature 42, before thread *A*
attempts to get the geometry for that feature? Even if those calls are
serialized, it is likely that thread A will get very confused."
Cheers,
Sy
> I think in general, guaranteeing thread safety when you have threads
> modifying data is in general extremely hard at the library level, and
> really requires some kind of thread coordination at the application
> program level. Maybe the datasource mutex could be exposed with a couple
> of handy Lock/Unlock methods to make this kind of high level
> coordination easier? In any case, shouldn't the RFC mention something
> about reading vs writing?
>
> Cheers,
>
> Simon
>
>
> Frank Warmerdam wrote:
>
>> Motion: To adopt RFC 16: OGR Thread Safety
>>
>> http://trac.osgeo.org/gdal/wiki/rfc16_ogr_reentrancy
>>
>> ---
>>
>> There wasn't to much discussion on this as far as I recall, which I take
>> to mean no one has a problem with it. So moving to formal vote so I can
>> implement this coming week.
>>
>> +1 from me.
>>
>> Best regards,
>>
>
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20071006/0370b32f/attachment.html
More information about the Gdal-dev
mailing list