tf::Worker
taskflow/core/worker.hpp
class friend class Executor Executor tf::Worker::Executor Executor
class friend class Runtime Runtime tf::Worker::Runtime Runtime
class friend class WorkerView WorkerView tf::Worker::WorkerView WorkerView
size_t size_t tf::Worker::_id _id tf::Worker::_id
size_t size_t tf::Worker::_vtm _vtm tf::Worker::_vtm
Executor * Executor* tf::Worker::_executor _executor tf::Worker::_executor {nullptr}
DefaultNotifier::Waiter * DefaultNotifier::Waiter* tf::Worker::_waiter _waiter tf::Worker::_waiter
std::default_random_engine std::default_random_engine tf::Worker::_rdgen _rdgen tf::Worker::_rdgen
std::uniform_int_distribution< size_t > std::uniform_int_distribution<size_t> tf::Worker::_rdvtm _rdvtm tf::Worker::_rdvtm
std::thread std::thread tf::Worker::_thread _thread tf::Worker::_thread
BoundedTaskQueue< Node * > BoundedTaskQueue<Node*> tf::Worker::_wsq _wsq tf::Worker::_wsq
size_t size_t tf::Worker::id () const id tf::Worker::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 tf::Worker::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 tf::Worker::queue_capacity

queries the current capacity of the queue

Executor * Executor * tf::Worker::executor () executor tf::Worker::executor

acquires the associated executor

std::thread & std::thread & tf::Worker::thread () thread tf::Worker::thread

acquires the associated thread

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
  _executor
- tf::Worker
  _id
- tf::Worker
  _rdgen
- tf::Worker
  _rdvtm
- tf::Worker
  _thread
- tf::Worker
  _vtm
- tf::Worker
  _waiter
- tf::Worker
  _wsq
- tf::Worker
  Executor
- tf::Worker
  executor
- tf::Worker
  id
- tf::Worker
  queue_capacity
- tf::Worker
  queue_size
- tf::Worker
  Runtime
- tf::Worker
  thread
- tf::Worker
  WorkerView