Details
Description
MosaicImageWriter writes the tiles in background threads, using as many threads than CPU. This speed up significantly the creation of an image mosaic. However one instance of ImageWriter is created for each thread. Worst, because many write operations are scheduled in advance, a lot of ImageWriters are created before they are actually needed.
This task improves the writting in two ways:
- The main thread blocks when all background threads are busy writting tiles. At most one task is submitted in advanced; other tasks have to wait that at least one thread become available.
- A pool of ImageWriter is used, so existing instances are recycled.
