|
C++ Concurrency Sandbox
|
#include <iostream>#include <vector>#include <thread>#include <functional>#include <mutex>#include <queue>#include <condition_variable>#include <atomic>#include <utility>Go to the source code of this file.
Classes | |
| class | ResultQueue< T > |
| A thread-safe template queue used for inter-thread communication. More... | |
| class | ThreadPool |
| Manages a collection of threads that execute tasks from a shared queue. More... | |
| struct | IsPrimeCalculator |
| A Functor (Function Object) that calculates primality. More... | |
Typedefs | |
| typedef std::function< void()> | Task |
Functions | |
| int | main () |
| Orchestrates the mass calculation and collection of results. | |
| typedef std::function<void()> Task |
Definition at line 63 of file MessagePassing.cpp.
| int main | ( | void | ) |
Orchestrates the mass calculation and collection of results.
Definition at line 168 of file MessagePassing.cpp.
References ThreadPool::enqueue(), IsPrimeCalculator::n, IsPrimeCalculator::outputQueue, and ResultQueue< T >::pop().