dispenso 1.4.1
A library for task parallelism
Loading...
Searching...
No Matches
thread_pool.h File Reference
#include <atomic>
#include <cassert>
#include <condition_variable>
#include <cstdlib>
#include <deque>
#include <mutex>
#include <thread>
#include <moodycamel/concurrentqueue.h>
#include <dispenso/detail/epoch_waiter.h>
#include <dispenso/detail/per_thread_info.h>
#include <dispenso/once_function.h>
#include <dispenso/platform.h>
#include <dispenso/tsan_annotations.h>

Go to the source code of this file.

Classes

class  dispenso::ThreadPool
 

Functions

DISPENSO_DLL_ACCESS ThreadPooldispenso::globalThreadPool ()
 
DISPENSO_DLL_ACCESS void dispenso::resizeGlobalThreadPool (size_t numThreads)
 

Detailed Description

A file providing ThreadPool. This is the heart of dispenso. All other scheduling paradigms, including TaskSets, Futures, pipelines, and parallel loops, are built on top of ThreadPool.

Definition in file thread_pool.h.

Function Documentation

◆ globalThreadPool()

DISPENSO_DLL_ACCESS ThreadPool & dispenso::globalThreadPool ( )

Get access to the global thread pool.

Returns
the global thread pool
Examples
for_each_example.cpp, graph_example.cpp, latch_example.cpp, and task_set_example.cpp.

◆ resizeGlobalThreadPool()

DISPENSO_DLL_ACCESS void dispenso::resizeGlobalThreadPool ( size_t numThreads)

Change the number of threads backing the global thread pool.

Parameters
numThreadsThe number of threads to back the global thread pool.