Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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  class HiveMgrSvc;
25 }
26 
27 namespace Gaudi {
28 
29  namespace Concurrency {
30 
32 
33  friend class ::ThreadPoolSvc;
34  friend class ::HiveWhiteBoard;
35  friend class SG::HiveMgrSvc; // ATLAS
36  friend class ::AthMpEvtLoopMgr; // ATLAS
37 
38  public:
42 
45  static GAUDI_API std::size_t numConcurrentEvents() { return n_concEvts; }
46 
49  static GAUDI_API std::size_t numProcs() { return n_procs; }
50 
53  static GAUDI_API bool concurrent() { return ( n_threads || n_concEvts || n_procs ); }
54 
55  private:
56  static GAUDI_API void setNumThreads( const std::size_t& nT ) { n_threads = nT; }
57  static GAUDI_API void setNumConcEvents( const std::size_t& nE ) { n_concEvts = nE; }
58  static GAUDI_API void setNumProcs( const std::size_t& nP ) { n_procs = nP; }
59 
60  private:
61  static std::size_t n_threads; // worker threads for MT
62  static std::size_t n_concEvts; // concurrent events for MT
63  static std::size_t n_procs; // child processes for MP
64  };
65  } // namespace Concurrency
66 } // namespace Gaudi
67 
68 #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)