[digiKam-users] How to have DK utilize multiple cores for maintenance tasks

Remco Viƫtor remco.vietor at wanadoo.fr
Wed Oct 14 09:15:02 BST 2020


On mercredi 14 octobre 2020 09:53:42 CEST Chris Green wrote:
> Thomas D <sdktda at gmail.com> wrote:
> > [-- text/plain, encoding 7bit, charset: UTF-8, 15 lines --]
> > 
> > Hi,
> > 
> > As part of another thread, I just learned how to increase the max size of
> > thumbnails.
> > When enabling large thumbnails in DK, I also have to rebuild all the
> > thumbnails.
> > This, however, is a huge computational task that takes a long time.
> > I noticed that DK seems to only utilize about 7 % CPU time. My machine has
> > 6 cores and I would like DK to utilize multiple cores. Maybe it already
> > does and I/O is the bottleneck? Or do I need to enable multi-threaded
> > thumbnail rebuilding somewhere?
> 
> Very, very few things use multiple cores.  The core i/o in the Linux
> kernel isn't (as far as I know) multithreaded, nor are any of the
> basic libraries.  Thus, even if you run lots of different 'things' at
> the same time - e.g. firefox, digikam, a mail program, etc. the CPU
> still only loads one processor.
> (...)

And reading from/writing to disk is *very* slow compared to processing. So no 
reason to look for trouble making thumbnail generation multi-threaded: no 
benefit, and MT-code is hard to get correct. 

Note that 7% CPU time corresponds to about half a core on a 6-core CPU...
And every thumbnail requires at least one disk read (original image) and one 
disk write (thumbnail).

Remco




More information about the Digikam-users mailing list