dispenso 1.4.1
A library for task parallelism
Loading...
Searching...
No Matches
Async & Futures

Asynchronous execution and future results. More...

Files

file  async_request.h
 
file  completion_event.h
 
file  future.h
 
file  timed_task.h
 

Detailed Description

Asynchronous execution and future results.

Futures, async requests, completion events, and timed tasks for asynchronous programming patterns.

Example: Using Futures

// Create a future that computes a value asynchronously
[]() { return 42; },
dispenso::globalThreadPool()
);
// Do other work...
// Get the result (blocks if not ready)
int result = future.get();
const Result & get() const
Definition future.h:219

Example: CompletionEvent for signaling

// In producer thread:
event.notify();
// In consumer thread:
event.wait(); // Blocks until notify() is called