RobWorkProject  23.9.11-
Classes | Macros | Typedefs
BS_thread_pool.hpp File Reference

BS::thread_pool: a fast, lightweight, and easy-to-use C++17 thread pool library. This header file contains the entire library, including the main BS::thread_pool class and the helper classes BS::multi_future, BS::blocks, BS:synced_stream, and BS::timer. More...

#include <atomic>
#include <chrono>
#include <condition_variable>
#include <exception>
#include <functional>
#include <future>
#include <iostream>
#include <memory>
#include <mutex>
#include <queue>
#include <thread>
#include <type_traits>
#include <utility>
#include <vector>

Classes

class  multi_future< T >
 A helper class to facilitate waiting for and/or getting the results of multiple futures at once. More...
 
class  blocks< T1, T2, T >
 A helper class to divide a range into blocks. Used by parallelize_loop() and push_loop(). More...
 
class  thread_pool
 A fast, lightweight, and easy-to-use C++17 thread pool class. More...
 
class  synced_stream
 A helper class to synchronize printing to an output stream by different threads. More...
 
class  timer
 A helper class to measure execution time for benchmarking purposes. More...
 

Macros

#define BS_THREAD_POOL_VERSION   "v3.4.0 (2023-05-12)"
 

Typedefs

using concurrency_t = std::invoke_result_t< decltype(std::thread::hardware_concurrency)>
 A convenient shorthand for the type of std::thread::hardware_concurrency(). Should evaluate to unsigned int.
 

Detailed Description

BS::thread_pool: a fast, lightweight, and easy-to-use C++17 thread pool library. This header file contains the entire library, including the main BS::thread_pool class and the helper classes BS::multi_future, BS::blocks, BS:synced_stream, and BS::timer.

Author
Barak Shoshany (barak.nosp@m.sh@g.nosp@m.mail..nosp@m.com) (http://baraksh.com)
Version
3.4.0
Date
2023-05-12