[geos-devel] Segmentation fault when using intersect with multithreading

Tanguy Fardet fardet.tanguy at laposte.net
Fri Nov 24 05:04:05 PST 2017


Thanks for the answer.

The situation is not necessarily bothersome to me now that I know about 
that fact.

The problem was that the API is labeled "thread safe" when it is not... 
When time permits, I think including a short documentation describing 
exactly what is safe and what is not would be a valuable addition for users.

Best,
Tanguy


Le 24/11/2017 à 08:46, Sandro Santilli a écrit :
> On Thu, Nov 23, 2017 at 06:05:56PM +0100, Tanguy Fardet wrote:
>> Hi again,
>>
>> just to let you know that the segfault dissapears if I store
>> oneGEOSPreparedGeometry copy of the global GEOSGeom evironment per OpenMP
>> thread and use the thread-specific copy in GEOSPreparedIntersects_r.
>>
>> Thus, it seems that, at least in my code and GEOS 3.6.2, the API is not
>> providing thread safe access to shared data using OpenMP.
> There's currently no use of locks in base classes to protect
> mutable resources, while there are some of them lazy cache
> creators. Improving that situation is welcome, if you are up
> to send patches.
>
> --strk;


More information about the geos-devel mailing list