[gdal-dev] Thread safety of RasterIO

Momtchil Momtchev momtchil at momtchev.com
Sat Oct 3 09:25:13 PDT 2020


Hello,


I am trying to add an async interface to node-gdal (the Node.js bindings 
for GDAL) and I can't find any official statement on the library's 
thread safety. There is an old FAQ on the trac server which states that 
one should not access the same GDALDataset from multiple threads but it 
has a section about GDAL 1.5 and another one about GDAL 2.x, so I guess 
that it is not really up to date.

There is also the RFC 47 that mentions a static global mutex (impacting 
the performance) which makes me think that synchronization is already 
taken care of?

Am I safe calling RasterIO on the same dataset from multiple threads? 
Are there some operations that work and others that do not? From what I 
have encountered so far, simple reading seems to work for me.


-- 
Momtchil Momtchev <momtchil at momtchev.com>



More information about the gdal-dev mailing list