batmat 0.0.19
Batched linear algebra routines
Loading...
Searching...
No Matches
thread-pool.hpp File Reference
#include <condition_variable>
#include <exception>
#include <functional>
#include <mutex>
#include <optional>
#include <stdexcept>
#include <thread>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

class  batmat::thread_pool
struct  batmat::thread_pool::Signals

Namespaces

namespace  batmat
namespace  batmat::detail

Functions

void batmat::pool_set_num_threads (size_t num_threads)
 Set the number of threads in the global thread pool.
template<class I = size_t, class F>
void batmat::pool_sync_run_all (F &&f)
 Run a function on all threads in the global thread pool, synchronously waiting for all threads.
template<class I = size_t, class F>
void batmat::pool_sync_run_n (I n, F &&f)
 Run a function on the first n threads in the global thread pool, synchronously waiting for those threads.

Variables

std::mutex batmat::detail::pool_mtx
std::optional< thread_poolbatmat::detail::pool

Class Documentation

◆ batmat::thread_pool::Signals

struct batmat::thread_pool::Signals
Class Members
mutex mtx
condition_variable_any cv