[Gdal-dev] Is OGR reentrant?

Tamas Szekeres szekerest at gmail.com
Fri Sep 22 14:10:31 EDT 2006


Hi,

Reentrancy is a stronger concept than thread-safety, because the second
attempt to perform the operation can even come from within the same thread.


Tamas


-----Original Message-----
From: gdal-dev-bounces at lists.maptools.org
[mailto:gdal-dev-bounces at lists.maptools.org] On Behalf Of Mateusz Loskot
Sent: Friday, September 22, 2006 5:26 PM
To: gdal-dev at lists.maptools.org
Subject: Re: [Gdal-dev] Is OGR reentrant?

ugeni79 at gmail.com wrote:
> Hi, I am using gdal 1.3.1 on windows and when I try to read from two 
> different shapefiles at the same time from two different threads my 
> application crashes.  Is OGR (or maybe in this case shapelib)
> supposed to be reentrant?  If not, has anyone looked at what it would
> take to make it reentrant? Any help would be greatly appreciated!

Are you talking about reentrance or thread-safety?
According to my understanding, both are different concepts.
Generally, reentrance provides calls across processes, but thread-safety
works across threads in frames of single process.

Certainly, it's possible function is reentrant and thread-safe at the
same time, but also function can be thread-safe but not reentrant, etc.

For GDAL thread-safety, please refer to FAQ 10.
http://www.gdal.org/faq.html
Note, I'm not sure how up to date is this FAQ.

For OGR thread-safety, I'm inclined to say that non-mutual access is
thread-safe in OGR. I also believe that more strict thread-safety can be
achived on the client side using threading capabilities provided by CPL.
Unfortunately, it doesn't apply to reentrance, because reentrance
requires much deeper changes and policies on (low) level of single
function call.

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net
_______________________________________________
Gdal-dev mailing list
Gdal-dev at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/gdal-dev

-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.8/455 - Release Date: 2006.09.22.
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.8/455 - Release Date: 2006.09.22.
 




More information about the Gdal-dev mailing list