Flow 1.0.2
Flow project: Full implementation reference.
timed_concurrent_task_loop.cpp
Go to the documentation of this file.
1/* Flow
2 * Copyright 2023 Akamai Technologies, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the
5 * "License"); you may not use this file except in
6 * compliance with the License. You may obtain a copy
7 * of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in
12 * writing, software distributed under the License is
13 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
14 * CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing
16 * permissions and limitations under the License. */
17
18/// @file
19
21
22namespace flow::async
23{
24
25// Implementations.
26
28 Impl(loop, clock_type,
29 // Thread-safe.
30 [](Time_accumulator* time_acc) -> perf::duration_rep_t { return time_acc->exchange(0); })
31{
32 // That's it. The above is why we exist as a subclass and not just an alias.
33}
34
35} // namespace flow::async
The core flow::async interface, providing an optionally multi-threaded thread pool onto which runnabl...
Decorator of a Concurrent_task_loop with same or greater lifetime that accumulates time elapsed in an...
Timed_concurrent_task_loop(Concurrent_task_loop *loop, perf::Clock_type clock_type=perf::Clock_type::S_CPU_THREAD_TOTAL_HI_RES)
Constructs a time-accumulating version of existing loop *loop.
std::atomic< perf::duration_rep_t > Time_accumulator
Convenience alias to our thread-safe tick accumulator type.
Flow module containing tools enabling multi-threaded event loops operating under the asynchronous-tas...
Definition: async_fwd.hpp:75
Duration::rep duration_rep_t
The raw type used in Duration to store its clock ticks.
Clock_type
Clock types supported by flow::perf module facilities, perf::Checkpointing_timer in particular.