1 #ifndef GAUDIHIVE_THREADPOOLSVC_H 2 #define GAUDIHIVE_THREADPOOLSVC_H 9 #include "boost/thread.hpp" 10 #include "tbb/spin_mutex.h" 11 #include "tbb/task_scheduler_init.h" StatusCode finalize() override final
Finalise.
ThreadPoolSvc(const std::string &name, ISvcLocator *svc)
Constructor.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
StatusCode terminatePool() override final
Terminate the thread pool and launch thread termination tasks.
const std::string & name() const override
Retrieve name of the service.
virtual bool isInit() const
int m_threadPoolSize
Size of the thread pool allocated.
bool m_init
Was the thread pool initialized?
This class is used for returning status codes from appropriate routines.
StatusCode initialize() override final
Initialise.
std::unique_ptr< boost::barrier > m_barrier
Barrier used to synchronization thread init tasks.
tbb::spin_mutex m_initMutex
Mutex used to protect the initPool and terminatePool methods.
Base class used to extend a class implementing other interfaces.
A service which initializes a TBB thread pool.
std::unique_ptr< tbb::task_scheduler_init > m_tbbSchedInit
TBB task scheduler initializer.
StatusCode initPool(const int &poolSize) override final
Initialize the thread pool and launch the ThreadInitTasks.
int poolSize() const override final
ToolHandleArray< IThreadInitTool > m_threadInitTools
Handle array of thread init tools.
StatusCode launchTasks(bool finalize=false)
Launch tasks to execute the ThreadInitTools.