group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
WorkerPool.hpp File Reference

Tiny persistent thread pool for parallel-for over short job ranges. More...

#include <atomic>
#include <condition_variable>
#include <cstddef>
#include <functional>
#include <mutex>
#include <thread>
#include <vector>
Include dependency graph for WorkerPool.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  WorkerPool

Detailed Description

Tiny persistent thread pool for parallel-for over short job ranges.

Designed for the per-frame "split this loop across N workers, wait for all to finish" pattern. Workers spin on a condition variable between jobs (no thread create / destroy churn), so the dispatch overhead is ~5–10 µs round-trip — small enough to be useful at 1000+ Hz frame rates for ranges that take more than a few µs of actual work.

Not a general-purpose scheduler: one job at a time, no priorities, no dependencies. Use it for parallel animation sampling, frustum culling, SoA component transforms, etc.