| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

ThreadPoolSvc.h
Go to the documentation of this file.
1 #ifndef GAUDIHIVE_THREADPOOLSVC_H
2 #define GAUDIHIVE_THREADPOOLSVC_H
3
4 #include "GaudiKernel/Service.h"
5 #include "GaudiKernel/IThreadPoolSvc.h"
6 #include "GaudiKernel/IThreadInitTool.h"
7 #include "GaudiKernel/ToolHandle.h"
8
9 #include "tbb/spin_mutex.h"
10 #include "tbb/task_scheduler_init.h"
11 #include "boost/thread.hpp"
12
13 #include <vector>
14
15 class ThreadPoolSvc: public extends<Service,
16 IThreadPoolSvc> {
17 public:
19 ThreadPoolSvc( const std::string& name, ISvcLocator* svc );
20
22 ~ThreadPoolSvc();
23
25 virtual StatusCode initialize();
26
28 virtual StatusCode finalize();
29
30
31 virtual StatusCode initPool(const int& poolSize);
32 virtual int poolSize() const {return m_threadPoolSize;}
33 virtual bool isInit() const { return m_init; }
34
35 virtual std::vector<IThreadInitTool*> getThreadInitTools() const;
36
37 private:
38
39 bool m_init;
40 int m_threadPoolSize;
41
42 ToolHandleArray<IThreadInitTool> m_threadInitTools;
43
44 tbb::spin_mutex m_initMutex;
45
46 tbb::task_scheduler_init* m_tbbSchedInit;
47
48 boost::barrier *m_barrier;
49
50
51 };
52
53 #endif
ThreadPoolSvc::ThreadPoolSvc
ThreadPoolSvc(const std::string &name, ISvcLocator *svc)
Constructor.
Definition: ThreadPoolSvc.cpp:19
IThreadPoolSvc.h
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
ThreadPoolSvc::m_barrier
boost::barrier * m_barrier
Definition: ThreadPoolSvc.h:48
ThreadPoolSvc::~ThreadPoolSvc
~ThreadPoolSvc()
Destructor.
Definition: ThreadPoolSvc.cpp:34
ThreadPoolSvc::isInit
virtual bool isInit() const
Definition: ThreadPoolSvc.h:33
ToolHandleArray< IThreadInitTool >
ThreadPoolSvc::m_threadPoolSize
int m_threadPoolSize
Definition: ThreadPoolSvc.h:40
std::string
STL class.
ThreadPoolSvc::initPool
virtual StatusCode initPool(const int &poolSize)
Definition: ThreadPoolSvc.cpp:92
Service.h
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
ThreadPoolSvc::m_init
bool m_init
Definition: ThreadPoolSvc.h:39
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ThreadPoolSvc::poolSize
virtual int poolSize() const
Definition: ThreadPoolSvc.h:32
ThreadPoolSvc::m_initMutex
tbb::spin_mutex m_initMutex
Definition: ThreadPoolSvc.h:44
ThreadPoolSvc::m_tbbSchedInit
tbb::task_scheduler_init * m_tbbSchedInit
Definition: ThreadPoolSvc.h:46
std::vector
STL class.
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
ThreadPoolSvc
Definition: ThreadPoolSvc.h:15
ToolHandle.h
ThreadPoolSvc::initialize
virtual StatusCode initialize()
Initialise.
Definition: ThreadPoolSvc.cpp:47
ThreadPoolSvc::m_threadInitTools
ToolHandleArray< IThreadInitTool > m_threadInitTools
Definition: ThreadPoolSvc.h:42
IThreadInitTool.h
ThreadPoolSvc::getThreadInitTools
virtual std::vector< IThreadInitTool * > getThreadInitTools() const
Definition: ThreadPoolSvc.cpp:177
ThreadPoolSvc::finalize
virtual StatusCode finalize()
Finalise.
Definition: ThreadPoolSvc.cpp:78