mm2 / Little-CMS

A free, open source, CMM engine. It provides fast transforms between ICC profiles.
https://www.littlecms.com
MIT License
549 stars 174 forks source link

threading plugin feature request: allow to replace the threading backend #386

Closed ajeb78 closed 1 year ago

ajeb78 commented 1 year ago

As I understand it the threading plugin uses pthreads for thread management. This means that in software that uses OpenMP for threading there may be a clash between OpenMP's understanding of how many threads are being used and pthreads' understanding of the same, resulting in overallocation of threads compared with the available number of virtual CPUs.

It would be nice to be able to replace the threading backend in a similar manner to what FFTW does (documentation at the bottom of this page).

mm2 commented 1 year ago

OpenMP takes a completely different approach, you mark parts of your code as able to be parallelized and the compiler does the job. Using pthreads or win32 API is a low level operation where you control all threading. The architecture of plug-in is based on having control on threads and cores. On the other hand OpenMP and pthreads can coexist. The plug in allows you to specify how many thereads it will use at most at init time. Regarding to replacing the threading backed, I put it on the wish list.

ajeb78 commented 1 year ago

Thank you :pray: