[Gdal-dev] Motion to Adopt RFC 16: OGR Thread Safety

Simon Perkins sy at perkins.net
Sun Oct 7 19:44:28 EDT 2007


Frank Warmerdam wrote:
> But I claim that application level locks are a poor solution for
> applications that want to have multiple active queries against a
> single layer (address by the GetLayerClone() mechanism).

The point I was trying to make is that if all the threads are just 
reading data from the Layers, then it's reasonable to implement 
synchronization at the library level as you suggest. However, as soon as 
you have a situation where one or more threads might modify those layers 
(or even delete them), then locking per library call is no longer 
sufficient. I just think the RFC should make this distinction clear.

As you point out, it's really not even sufficient to lock at the 
application level either since multiple applications might be accessing 
the same shared data source. For RDBMSes is it possible to have the 
DataSource mutex actually lock something at the database level? If this 
mutex is exposed by the DataSource API for application level locking, 
then this would provide considerable protection against overlapping updates.

Cheers,

Sy




More information about the Gdal-dev mailing list