tf::Worker
taskflow/core/worker.hpp
class friend class Executor Executor Executor
class friend class WorkerView WorkerView WorkerView
size_t size_t tf::Worker::_id _id
size_t size_t tf::Worker::_vtm _vtm
Executor * Executor* tf::Worker::_executor _executor {nullptr}
std::default_random_engine std::default_random_engine tf::Worker::_rdgen _rdgen { std::random_device{}() }
BoundedTaskQueue< Node * > BoundedTaskQueue<Node*> tf::Worker::_wsq _wsq
Node * Node* tf::Worker::_cache _cache {nullptr}
DefaultNotifier::Waiter * DefaultNotifier::Waiter* tf::Worker::_waiter _waiter
size_t size_t tf::Worker::id () const id

queries the worker id associated with its parent executor

A worker id is a unsigned integer in the range `[0, N)`, where `N` is the number of workers spawned at the construction time of the executor.

size_t size_t tf::Worker::queue_size () const queue_size

queries the size of the queue (i.e., number of enqueued tasks to run) associated with the worker

size_t size_t tf::Worker::queue_capacity () const queue_capacity

queries the current capacity of the queue

class to create a worker in an executor

The class is primarily used by the executor to perform work-stealing algorithm. Users can access a worker object and alter its property (e.g., changing the thread affinity in a POSIX-like system) using tf::WorkerInterface.

- tf::Worker
  _cache
- tf::Worker
  _executor
- tf::Worker
  _id
- tf::Worker
  _rdgen
- tf::Worker
  _vtm
- tf::Worker
  _waiter
- tf::Worker
  _wsq
- tf::Worker
  Executor
- tf::Worker
  id
- tf::Worker
  queue_capacity
- tf::Worker
  queue_size
- tf::Worker
  WorkerView