Package: gscan2pdf Version: 2.8.2-1 Parallel processing - Becoming more urgent with rapidly increasing multi-core CPUs
As computers have more and more cores, it is becoming more urgent that gscan2pdf supports parallel processing, especially considering that many image operations are CPU intensive. Currently, it is relatively common to have 10+ cores available and 100+ cores do exist at the high-end. In these situations, gscan2pdf is only using 10% or even 1% of available processing power. I saw some mention in an issue that most of the underlying libraries were already multi-threaded. This is not entirely true, as unfortunately, many of the underlying algorithms are still and will probably remain single threaded by the nature of the algorithms. I also saw some mention that this was more complicated than expected. The simplest and safest approach is to have a separate processing queue for each incoming image (scanned or imported). Each image would receive a unique ID for the session and all operations on it would be sequenced for the image, but all images being processed in parallel. Eg: Scan Image 1, Convert to PNG, Apply clean-up filters, rotate. all processed in strict sequential order. However, Image 1 queue is processed in parallel with Image 2 queue, Image 3 queue, etc... All of the features in gscan2pdf seem to be per image, I did not see any multi-image options, such as combining two images, the only exception being the save file. If there are any others, the simplest would be to force these as sequential in a global queue. The global queue would only process multi-image operations once all previously queued parallel operations have completed. Subsequent parallel operations should come only after the multi-image operation completed.