Skip to content

[WIP] separate thread pool stuff from Schedulers

Charles Leggett requested to merge leggett/Gaudi:dev/hive/ThreadSvc into hive

Creates a new service, the ThreadPoolSvc, which separates the creation of the thread pool from the hive scheduler. It also offers the ability to do thread local initialization in each thread, via special AlgTools. These Tools are declared to the ThreadPoolSvc via a ToolHandleArray jobopt "ThreadInitTools".

The ToolHandleArray is wrapped in a tbb::task (ThreadInitTask), and N copies are enqueued to the scheduler, for a thread pool size N. Upon execution of the task, it retrieves a private copy of the ToolHandleArray, so that a separate instance of each tool is executed in each thread. The Service and these tasks wait at a boost::barrier until all have been executed, which ensures that a task is run in each thread. An atomic counter is incremented by each tool upon successful completion, which is used as a check by the service - if the total count is less than the number of threads, then there was a failure.

Merge request reports