The Gaudi Framework  v29r0 (ff2e7097)
IOBoundAlgSchedulerSvc.h
Go to the documentation of this file.
1 #ifndef GAUDIHIVE_IOBOUNDALGSCHEDULERSVC_H
2 #define GAUDIHIVE_IOBOUNDALGSCHEDULERSVC_H
3 
4 #include <functional>
5 #include <thread>
6 
7 // Framework include files
9 #include "GaudiKernel/IAlgTask.h"
10 #include "GaudiKernel/IRunable.h"
11 #include "GaudiKernel/Service.h"
12 
13 // External libs
14 #include "tbb/concurrent_queue.h"
15 
16 //---------------------------------------------------------------------------
17 
25 class IOBoundAlgSchedulerSvc : public extends1<Service, IAccelerator>
26 {
27 public:
30 
32  ~IOBoundAlgSchedulerSvc() override;
33 
35  StatusCode initialize() override;
36 
38  StatusCode finalize() override;
39 
41  StatusCode push( IAlgTask& task ) override;
42 
43 private:
44  // Utils and shortcuts ----------------------------------------------------
45 
47  void activate();
48 
51 
53  bool m_isActive;
54 
57 
58  // Actions management -----------------------------------------------------
59 
62  // typedef std::shared_ptr<action> actionPtr;
64  tbb::concurrent_bounded_queue<action> m_actionsQueue;
65 };
66 
67 #endif // GAUDIHIVE_IOBOUNDALGSCHEDULERSVC_H
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
bool m_isActive
Flag to track if the scheduler is active or not.
std::thread m_thread
The thread in which the activate function runs.
~IOBoundAlgSchedulerSvc() override
Destructor.
std::function< StatusCode()> action
StatusCode initialize() override
Initialise.
STL class.
General interface for a wrapper around Gaudi algorithm.
Definition: IAlgTask.h:15
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
StatusCode deactivate()
Deactivate scheduler.
IOBoundAlgSchedulerSvc(const std::string &name, ISvcLocator *svc)
Constructor.
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
void activate()
Activate scheduler.
StatusCode push(IAlgTask &task) override
Add an algorithm to local queue to run on accelerator.
StatusCode finalize() override
Finalise.
Please refer to the full documentation of the methods for more details.
tbb::concurrent_bounded_queue< action > m_actionsQueue
This is done since the copy of the lambda storage is too expensive.
STL class.