[gdal-dev] Mutex around Proj.4

Kevin Bentley kevin.bentley at gmail.com
Sun May 2 18:06:40 EDT 2010

I was profiling some code today with vtune, and it turned out that the
mutex around proj4 in gdal was the biggest culprit. I had code that
was calling Transform many times with one point at a time. I was able
to improve things a lot by calling it with multiple points, but
acquiring the mutex is still a huge hit to my performance (to be fair
I'm still calling Transform a *lot*, I can't easily refactor the code
to make it work in more of a batch).

I'm just curious what the issue with proj.4 and multiple threads are
in gdal. I'm thinking of writing my own little wrapper around proj.4
to avoid the mutex, but I don't want to do that if I'm going to run
into the same problems that caused the mutex to be put in there. I've
got multiple threads working on a lot of transforms, so if I can avoid
the mutex it would really help performance.

I noticed it was added a while ago:

 * Revision 1.28  2005/06/08 19:38:14  fwarmerdam
 * protect PROJ.4 use with a mutex


Kevin Bentley

More information about the gdal-dev mailing list