Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
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 main thread pool class and some additional classes and definitions. No other files are needed in order to use the thread pool itself. More...

#include <chrono>
#include <condition_variable>
#include <cstddef>
#include <functional>
#include <future>
#include <memory>
#include <mutex>
#include <optional>
#include <queue>
#include <thread>
#include <type_traits>
#include <utility>
#include <vector>
Include dependency graph for BS_thread_pool.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  BS::this_thread::thread_info_index
 A helper class to store information about the index of the current thread. More...
 
class  BS::this_thread::thread_info_pool
 A helper class to store information about the thread pool that owns the current thread. More...
 
class  BS::multi_future< T >
 A helper class to facilitate waiting for and/or getting the results of multiple futures at once. More...
 
class  BS::thread_pool
 A fast, lightweight, and easy-to-use C++17 thread pool class. More...
 
class  BS::thread_pool::blocks< T >
 A helper class to divide a range into blocks. Used by detach_blocks(), submit_blocks(), detach_loop(), and submit_loop(). More...
 

Namespaces

namespace  BS
 A namespace used by Barak Shoshany's projects.
 
namespace  BS::this_thread
 A namespace used to obtain information about the current thread.
 

Macros

#define BS_THREAD_POOL_DISABLE_EXCEPTION_HANDLING
 
#define BS_THREAD_POOL_VERSION_MAJOR   4
 
#define BS_THREAD_POOL_VERSION_MINOR   1
 
#define BS_THREAD_POOL_VERSION_PATCH   0
 
#define BS_THREAD_POOL_PRIORITY_INPUT
 
#define BS_THREAD_POOL_PRIORITY_OUTPUT
 
#define BS_THREAD_POOL_PAUSED_OR_EMPTY   tasks.empty()
 

Typedefs

using BS::size_t = std::size_t
 A type to represent the size of things.
 
using BS::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.
 
using BS::this_thread::optional_index = std::optional< size_t >
 A type returned by BS::this_thread::get_index() which can optionally contain the index of a thread, if that thread belongs to a BS::thread_pool. Otherwise, it will contain no value.
 
using BS::this_thread::optional_pool = std::optional< thread_pool * >
 A type returned by BS::this_thread::get_pool() which can optionally contain the pointer to the pool that owns a thread, if that thread belongs to a BS::thread_pool. Otherwise, it will contain no value.
 

Variables

thread_local thread_info_index BS::this_thread::get_index
 A thread_local object used to obtain information about the index of the current thread.
 
thread_local thread_info_pool BS::this_thread::get_pool
 A thread_local object used to obtain information about the thread pool that owns the current thread.
 

Detailed Description

BS::thread_pool: a fast, lightweight, and easy-to-use C++17 thread pool library. This header file contains the main thread pool class and some additional classes and definitions. No other files are needed in order to use the thread pool itself.

Author
Barak Shoshany (barak.nosp@m.sh@g.nosp@m.mail..nosp@m.com) (https://baraksh.com)
Version
4.1.0
Date
2024-03-22