⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
userver
C++ Async Framework v2.0
Documentation
API Groups
Namespaces
Reference
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
w
y
Variables
k
n
r
u
w
Typedefs
c
d
h
m
n
o
p
s
t
u
v
Enumerations
a
b
c
d
f
h
i
l
o
p
r
s
t
u
v
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
~
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
Enumerations
Enumerator
Related Symbols
File List
File Members
All
e
i
l
r
t
u
Functions
Macros
e
i
l
r
t
u
Examples
Toggle main menu visibility
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
Loading...
Searching...
No Matches
All results
asymmetric_fence.hpp
1
#
pragma
once
2
3
USERVER_NAMESPACE_BEGIN
4
5
namespace
concurrent
::impl {
6
7
// A pair of AsymmetricThreadFenceLight + AsymmetricThreadFenceHeavy
8
// synchronizes like std::atomic_thread_fence(std::memory_order_seq_cst)
9
//
10
// Light version is very fast (~1ns) and Heavy version is quite slow
11
// (1 context switch per CPU core ~1us).
12
//
13
// Supported systems: x86_64 Linux with kernel version 4.14+.
14
// On other systems, these are implemented as
15
// std::atomic_thread_fence(std::memory_order_seq_cst).
16
//
17
// See:
18
// https://man.archlinux.org/man/membarrier.2.ru
19
// https://wg21.link/p1202
20
// https://github.com/facebook/folly/blob/main/folly/synchronization/AsymmetricThreadFence.cpp
21
void
AsymmetricThreadFenceLight()
noexcept
;
22
void
AsymmetricThreadFenceHeavy()
noexcept
;
23
24
// Automatic thread registration for asymmetric thread fences uses
25
// an unprotected thread_local access. On thread pools of thread-migrating
26
// coroutines, this should be called before any AsymmetricThreadFence* calls.
27
void
AsymmetricThreadFenceForceRegisterThread()
noexcept
;
28
29
}
// namespace concurrent::impl
30
31
USERVER_NAMESPACE_END
Docs version:
v1.0
,
v2.0
,
trunk/develop
userver
concurrent
impl
asymmetric_fence.hpp
Generated on Wed May 15 2024 22:15:50 for userver by
Doxygen
1.10.0