Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework
master (f31105fd)
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Typedefs
a
b
c
d
e
f
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerations
a
c
d
e
f
i
l
m
n
o
p
q
r
s
t
v
Enumerator
a
b
c
d
e
f
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Properties
Related Functions
:
a
b
c
d
e
g
h
i
m
o
p
r
s
t
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
b
c
e
f
g
h
i
l
m
n
o
p
r
s
t
u
z
Variables
a
b
c
d
e
g
h
i
m
o
p
q
r
s
t
v
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
Enumerations
Enumerator
c
e
f
p
u
v
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
FiberManager.h
Go to the documentation of this file.
1
2
/***********************************************************************************\
3
* (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
4
* *
5
* This software is distributed under the terms of the Apache version 2 licence, *
6
* copied verbatim in the file "LICENSE". *
7
* *
8
* In applying this licence, CERN does not waive the privileges and immunities *
9
* granted to it by virtue of its status as an Intergovernmental Organization *
10
* or submit itself to any jurisdiction. *
11
\***********************************************************************************/
12
#pragma once
13
#include <boost/fiber/algo/shared_work.hpp>
14
#include <boost/fiber/condition_variable.hpp>
15
#include <boost/fiber/fiber.hpp>
16
#include <boost/fiber/mutex.hpp>
17
#include <boost/version.hpp>
18
#if ( BOOST_VERSION >= 108400 )
19
# include <boost/fiber/stack_allocator_wrapper.hpp>
20
#endif
21
34
class
FiberManager
{
35
36
public
:
42
FiberManager
(
int
n_threads
);
43
~FiberManager
();
44
53
template
<
typename
F>
54
void
schedule
( F&&
func
) {
55
boost::fibers::fiber( boost::fibers::launch::post, std::forward<F>(
func
) ).detach();
56
for
(
auto
* p :
m_schedAlgoList
) { p->notify(); }
57
}
58
59
private
:
60
using
SchedAlgo
= boost::fibers::algo::shared_work;
61
boost::fibers::condition_variable
m_shuttingDown_cv
{};
62
boost::fibers::mutex
m_shuttingDown_mtx
{};
63
std::vector<std::thread>
m_threads
{};
64
std::vector<SchedAlgo*>
m_schedAlgoList
{};
65
};
FiberManager
Definition:
FiberManager.h:34
FiberManager::m_threads
std::vector< std::thread > m_threads
Definition:
FiberManager.h:63
prepareBenchmark.n_threads
n_threads
Definition:
prepareBenchmark.py:40
std::vector< std::thread >
FiberManager::~FiberManager
~FiberManager()
Definition:
FiberManager.cpp:41
FiberManager::m_schedAlgoList
std::vector< SchedAlgo * > m_schedAlgoList
Definition:
FiberManager.h:64
FiberManager::SchedAlgo
boost::fibers::algo::shared_work SchedAlgo
Definition:
FiberManager.h:60
cpluginsvc.func
func
Definition:
cpluginsvc.py:235
FiberManager::schedule
void schedule(F &&func)
Schedule work to run on the asynchronous pool.
Definition:
FiberManager.h:54
FiberManager::FiberManager
FiberManager(int n_threads)
FiberManager constructor.
Definition:
FiberManager.cpp:14
FiberManager::m_shuttingDown_mtx
boost::fibers::mutex m_shuttingDown_mtx
Definition:
FiberManager.h:62
FiberManager::m_shuttingDown_cv
boost::fibers::condition_variable m_shuttingDown_cv
Definition:
FiberManager.h:61
GaudiHive
src
FiberManager.h
Generated on Mon Apr 7 2025 16:26:21 for The Gaudi Framework by
1.8.18