<div dir="ltr"><div>DigiKam already uses multicore in many places. Almost all image editing tools use all CPU cores. Copying files is scaled to all cores. Face recognition can use all CPU cores, etc. We have a problem if loading images. A thumbnail can usually be quickly extracted from an existing preview, if not, the complete image has to be loaded into memory and then scaled down, depending on the image type. I have Giga Pixel test images from users that take up 3.5 gigabytes in memory. If we scale this to all cores, we need more than 20 gigabytes of main memory for such images. This means that the image loader would have to tell all tasks beforehand how much memory is required and the other loader tasks would have to pause. But the file IO on network drives also has limits. And last but not least, 6 tasks cannot write to the SQLite DB at the same time, only one at a time...</div><div><br></div><div>Maik<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am Mi., 14. Okt. 2020 um 10:16 Uhr schrieb Remco Viëtor <<a href="mailto:remco.vietor@wanadoo.fr">remco.vietor@wanadoo.fr</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On mercredi 14 octobre 2020 09:53:42 CEST Chris Green wrote:<br>
> Thomas D <<a href="mailto:sdktda@gmail.com" target="_blank">sdktda@gmail.com</a>> wrote:<br>
> > [-- text/plain, encoding 7bit, charset: UTF-8, 15 lines --]<br>
> > <br>
> > Hi,<br>
> > <br>
> > As part of another thread, I just learned how to increase the max size of<br>
> > thumbnails.<br>
> > When enabling large thumbnails in DK, I also have to rebuild all the<br>
> > thumbnails.<br>
> > This, however, is a huge computational task that takes a long time.<br>
> > I noticed that DK seems to only utilize about 7 % CPU time. My machine has<br>
> > 6 cores and I would like DK to utilize multiple cores. Maybe it already<br>
> > does and I/O is the bottleneck? Or do I need to enable multi-threaded<br>
> > thumbnail rebuilding somewhere?<br>
> <br>
> Very, very few things use multiple cores. The core i/o in the Linux<br>
> kernel isn't (as far as I know) multithreaded, nor are any of the<br>
> basic libraries. Thus, even if you run lots of different 'things' at<br>
> the same time - e.g. firefox, digikam, a mail program, etc. the CPU<br>
> still only loads one processor.<br>
> (...)<br>
<br>
And reading from/writing to disk is *very* slow compared to processing. So no <br>
reason to look for trouble making thumbnail generation multi-threaded: no <br>
benefit, and MT-code is hard to get correct. <br>
<br>
Note that 7% CPU time corresponds to about half a core on a 6-core CPU...<br>
And every thumbnail requires at least one disk read (original image) and one <br>
disk write (thumbnail).<br>
<br>
Remco<br>
<br>
<br>
</blockquote></div>