The Gaudi Framework  v30r4 (9b837755)
ConcurrencyFlags.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_CONCURRENCYFLAGS_H
2 #define GAUDIKERNEL_CONCURRENCYFLAGS_H 1
3 
4 #include <cstddef>
5 
6 #include "GaudiKernel/Kernel.h"
7 
8 class ThreadPoolSvc;
9 class HiveWhiteBoard;
10 class SGHiveMgrSvc;
11 class AthMpEvtLoopMgr;
12 
23 namespace SG
24 {
25  class HiveMgrSvc;
26 }
27 
28 namespace Gaudi
29 {
30 
31  namespace Concurrency
32  {
33 
35  {
36 
37  friend class ::ThreadPoolSvc;
38  friend class ::HiveWhiteBoard;
39  friend class SG::HiveMgrSvc; // ATLAS
40  friend class ::AthMpEvtLoopMgr; // ATLAS
41 
42  public:
46 
49  static GAUDI_API std::size_t numConcurrentEvents() { return n_concEvts; }
50 
53  static GAUDI_API std::size_t numProcs() { return n_procs; }
54 
57  static GAUDI_API bool concurrent() { return ( n_threads || n_concEvts || n_procs ); }
58 
59  private:
60  static GAUDI_API void setNumThreads( const std::size_t& nT ) { n_threads = nT; }
61  static GAUDI_API void setNumConcEvents( const std::size_t& nE ) { n_concEvts = nE; }
62  static GAUDI_API void setNumProcs( const std::size_t& nP ) { n_procs = nP; }
63 
64  private:
65  static std::size_t n_threads; // worker threads for MT
66  static std::size_t n_concEvts; // concurrent events for MT
67  static std::size_t n_procs; // child processes for MP
68  };
69  }
70 }
71 
72 #endif
static GAUDI_API void setNumThreads(const std::size_t &nT)
static GAUDI_API std::size_t numThreads()
number of Worker Threads (for MT)
static GAUDI_API void setNumProcs(const std::size_t &nP)
static GAUDI_API std::size_t numProcs()
number of forked child processes (for MP)
static GAUDI_API bool concurrent()
serial operation, or some form of concurrency
Data service base class.
A service which initializes a TBB thread pool.
Definition: ThreadPoolSvc.h:26
#define GAUDI_API
Definition: Kernel.h:71
Helper functions to set/get the application return code.
Definition: __init__.py:1
static GAUDI_API void setNumConcEvents(const std::size_t &nE)
static GAUDI_API std::size_t numConcurrentEvents()
number of Concurrent Events (for MT)