On 10/14/2022 3:00 AM, Even Rouault wrote:

Hi,

just wanted to point that if you are interested in a "framework" for submit jobs to a thread pool, I can point to

https://github.com/uclouvain/openjpeg/blob/master/src/lib/openjp2/thread.h

https://github.com/uclouvain/openjpeg/blob/master/src/lib/openjp2/thread.c

which is a port in C I've done from the equivalent C++ code of GDAL (https://github.com/OSGeo/gdal/blob/master/port/cpl_worker_thread_pool.h).

It has a pthread and Win32 implementation. It could be easily extracted from libopenjp2 (pending a opj_ -> grass_ renaming to avoid conflicts if both are combined)

The high level API is the opj_thread_pool_* one.

Probably not super fancy, but serves my need well. The user is responsible for selecting the number of threads and splitting the work load in jobs that are queued to the thread pool and consumed by the threads as soon as they are no longer busy.

Thank you for the pointers and links. I will definitely take a look at it and see what I can incorporate. Between this and the various drivers, I think I have more than enough to work on for awhile.

Thank you all for indulging and tolerating my questions.


--
Best Regards,
-Brad
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to