Discussion:
[gdal-dev] Mutexes
Andrew Bell
2021-05-03 15:23:03 UTC
Permalink
Hi,

I'm looking at code in gdalwarpkernel.cpp and there are calls to
CPLAcquireMutex that take a "timeout" argument. From looking at
cpl_multiproc, on a non-windows system it seems the timeout is ignored, but
on WIN32 it is respected in the call, but the return value is generally
ignored, meaning that the subsequent code could run without the lock having
been acquired.

This seems like strange behavior. Is there a reason for the different
behavior on Windows and not-Windows? Am I missing something?

Thanks,
--
Andrew Bell
***@gmail.com
Even Rouault
2021-05-03 15:26:14 UTC
Permalink
Andrew,

I don't see myself much value to the mutexes with timeout, at least in
how they are used within GDAL. What you underline was actually reported
in https://github.com/OSGeo/gdal/issues/3631. The fix would be to use a
non-timeout mutex

Even
Post by Andrew Bell
Hi,
I'm looking at code in gdalwarpkernel.cpp and there are calls to
CPLAcquireMutex that take a "timeout" argument. From looking at
cpl_multiproc, on a non-windows system it seems the timeout is
ignored, but on WIN32 it is respected in the call, but the return
value is generally ignored, meaning that the subsequent code could run
without the lock having been acquired.
This seems like strange behavior. Is there a reason for the different
behavior on Windows and not-Windows? Am I missing something?
Thanks,
--
Andrew Bell
_______________________________________________
gdal-dev mailing list
https://lists.osgeo.org/mailman/listinfo/gdal-dev
--
http://www.spatialys.com
My software is free, but my time generally not.
Loading...