Multithreaded writing skips random blocks
|multithread block cache writing driver
In a multithreading scenario involving simultaneous writing, eventhough different output datasets, random blocks appear to be empty in the resulting rasters. This is apparently happening when the block cache gets full during writing process.
It seems that 2 or more threads writing simultaneously, mess up the block cache to each other when trying to flush dirty blocks.
I have reproduced the issue with a custom-made driver based on GDALPam inheritance, but it also happens with ENVI driver, and presumably with other drivers.
Find in the following link a test case and a sample raster to reproduce the issue: https://drive.google.com/open?id=0B-OCl1FjBi0YUkN4WWZmRjRfM1k