A collection of running Worker threads that a MicroScheduler can be run on.
More...
#include <WorkerPool.h>
|
static void | resetIdGenerator () |
| Resets the ID generator to 0. This is not safe if there are any living MicroSchedulers.
|
|
|
class | Worker |
|
class | LocalScheduler |
|
class | MicroScheduler |
|
A collection of running Worker threads that a MicroScheduler can be run on.
◆ WorkerPool()
gts::WorkerPool::WorkerPool |
( |
| ) |
|
◆ ~WorkerPool()
gts::WorkerPool::~WorkerPool |
( |
| ) |
|
Implicitly calls shutdown.
◆ currentMicroScheduler()
◆ enumerateWorkerIds()
void gts::WorkerPool::enumerateWorkerIds |
( |
Vector< OwnedId > & |
out | ) |
const |
- Returns
- A vector of all Worker IDs in the pool.
◆ enumerateWorkerTids()
void gts::WorkerPool::enumerateWorkerTids |
( |
Vector< ThreadId > & |
out | ) |
const |
- Returns
- A vector of all Worker OS Thread IDs in the pool, indexed by local ID.
◆ initialize() [1/2]
bool gts::WorkerPool::initialize |
( |
uint32_t |
threadCount = 0 | ) |
|
Simple thread count initializer. If threadCount is zero, initializes with hardware thread count.
◆ initialize() [2/2]
◆ isRunning()
GTS_INLINE bool gts::WorkerPool::isRunning |
( |
| ) |
const |
|
inline |
- Returns
- True if the scheduler is running, false otherwise.
◆ poolId()
GTS_INLINE SubIdType gts::WorkerPool::poolId |
( |
| ) |
const |
|
inline |
◆ shutdown()
bool gts::WorkerPool::shutdown |
( |
| ) |
|
Stops and destroys all workers.
◆ thisWorkerId()
OwnedId gts::WorkerPool::thisWorkerId |
( |
| ) |
const |
- Returns
- The calling Worker thread's index.
◆ workerCount()
GTS_INLINE uint32_t gts::WorkerPool::workerCount |
( |
| ) |
const |
|
inline |
- Returns
- The number of worker threads in the scheduler.