dispenso 1.4.1
A library for task parallelism
Loading...
Searching...
No Matches
Core Components

Thread pools and task management fundamentals. More...

Files

file  once_function.h
 
file  schedulable.h
 
file  task_set.h
 
file  thread_pool.h
 

Detailed Description

Thread pools and task management fundamentals.

The core components provide the foundation for all parallel execution in dispenso. This includes the ThreadPool class which is the heart of dispenso, as well as TaskSet for managing groups of related tasks, and supporting types like OnceFunction and Schedulable.

Example: Using ThreadPool and TaskSet

// Use the global thread pool
dispenso::TaskSet tasks(dispenso::globalThreadPool());
// Schedule multiple tasks
tasks.schedule([]() { /* task 1 */ });
tasks.schedule([]() { /* task 2 */ });
tasks.schedule([]() { /* task 3 */ });
// Wait for all tasks to complete
tasks.wait();