Just the fact that they then basically hog the whole system is a bit annoying and is perhaps something that can be improved/changed, e.g. by spawning more threads?
If I understand you correctly, it was possible that new threads got started for images that were already being processed (e.g. when switching back to a query/contact sheet with those same images). This should, of course, be prevented since that would consume resources unnecessarily.
There are multiple constraining factors, currently:
- Fixed pool of image worker threads (based on cpu cores)
- Workers not designed to be interruptible
- On-screen images have priority, but off-screen image precache is scheduled when otherwise idle
- Multiple threads competing for I/O on a non-SSD drive is slow, so exclusive locking is used to serialize I/O
So, for example, simply spawning more worker threads doesn't help if they must ultimately wait for the I/O lock, owned by another thread loading a huge file.
That said, I can see ways to improve the existing system (making I/O serialization somewhat more granular; etc.)
Nevertheless, multiple constraints must be eased to solve this.