Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
Loading...
Searching...
No Matches
future_extensions.h File Reference

Future and promise utilities for thread pool. More...

#include <kcenon/thread/forward.h>
#include <kcenon/thread/core/error_handling.h>
#include <future>
#include <memory>
#include <chrono>
#include <functional>
Include dependency graph for future_extensions.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  kcenon::thread::pool_future< T >
 A future that can be scheduled on a thread pool. More...
 
class  kcenon::thread::pool_promise< T >
 A promise that can schedule work on a thread pool. More...
 
class  kcenon::thread::pool_promise< void >
 Specialization for void type. More...
 

Namespaces

namespace  kcenon
 
namespace  kcenon::thread
 Core threading foundation of the thread system library.
 

Functions

template<typename T >
pool_future< std::decay_t< T > > kcenon::thread::make_ready_future (T &&value)
 Create a future that is already ready with a value.
 
pool_future< void > kcenon::thread::make_ready_future ()
 Create a future that is already ready with void.
 
template<typename T >
pool_future< T > kcenon::thread::make_exceptional_future (std::exception_ptr exception)
 Create a future that is already ready with an exception.
 
template<typename... Futures>
void kcenon::thread::wait_for_all (Futures &... futures)
 Wait for all futures to complete.
 
template<typename... Futures>
size_t kcenon::thread::wait_for_any (Futures &... futures)
 Wait for any future to complete.
 

Detailed Description

Future and promise utilities for thread pool.

This file provides extensions to std::future and std::promise that integrate well with the thread pool system.

Definition in file future_extensions.h.