proxygen
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
new_thread.h
Go to the documentation of this file.
1
/*
2
* Copyright 2018-present Facebook, Inc.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
#pragma once
17
18
#include <
folly/experimental/pushmi/executor.h
>
19
#include <
folly/experimental/pushmi/trampoline.h
>
20
21
namespace
folly
{
22
namespace
pushmi {
23
24
// very poor perf example executor.
25
//
26
27
struct
new_thread_executor
{
28
using
properties
=
property_set
<
29
is_sender<>
,
30
is_executor<>
,
31
is_never_blocking<>
,
32
is_concurrent_sequence<>
,
33
is_single<>
>;
34
35
new_thread_executor
executor
() {
36
return
{};
37
}
38
PUSHMI_TEMPLATE
(
class
Out)
39
(
requires
Receiver<Out>)
40
void
submit
(Out out) {
41
std::thread
t
{[out =
std::move
(out)]()
mutable
{
42
auto
tr
=
::folly::pushmi::trampoline
();
43
::folly::pushmi::submit
(
tr
,
std::move
(out));
44
}};
45
// pass ownership of thread to out
46
t
.detach();
47
}
48
};
49
50
inline
new_thread_executor
new_thread
() {
51
return
{};
52
}
53
54
}
// namespace pushmi
55
}
// namespace folly
folly::pushmi::t
requires Tuple && t
Definition:
extension_operators.h:60
folly::pushmi::is_single<>
Definition:
concepts.h:70
folly::pushmi::trampoline
detail::delegator< E > trampoline()
Definition:
trampoline.h:261
submit
submit
Definition:
PushmiBenchmarks.cpp:540
folly::pushmi::property_set
Definition:
forwards.h:34
folly::pushmi::new_thread_executor::submit
requires Receiver< Out > void submit(Out out)
Definition:
new_thread.h:40
folly::gen::move
constexpr detail::Map< Move > move
Definition:
Base-inl.h:2567
executor.h
folly::pushmi::is_sender<>
Definition:
concepts.h:134
folly::pushmi::is_never_blocking<>
Definition:
concepts.h:218
folly::pushmi::new_thread_executor::executor
new_thread_executor executor()
Definition:
new_thread.h:35
folly
—— Concurrent Priority Queue Implementation ——
Definition:
AtomicBitSet.h:29
folly::pushmi::new_thread
new_thread_executor new_thread()
Definition:
new_thread.h:50
tr
auto tr
Definition:
PushmiBenchmarks.cpp:483
trampoline.h
folly::pushmi::new_thread_executor
Definition:
new_thread.h:27
folly::pushmi::is_executor<>
Definition:
concepts.h:153
folly::pushmi::requires
requires requires(detail::apply_impl(std::declval< F >(), std::declval< Tuple >(), detail::tupidxs< Tuple >{}))) const expr decltype(auto) apply(F &&f
folly::pushmi::PUSHMI_TEMPLATE
PUSHMI_TEMPLATE(class E=std::exception_ptr, class Wrapped)(requires Sender< detail
Definition:
executor.h:102
folly::pushmi::is_concurrent_sequence<>
Definition:
concepts.h:272
proxygen
folly
folly
experimental
pushmi
new_thread.h
Generated by
1.8.11