JANA2
JWorker Class Reference
Collaboration diagram for JWorker:

Public Types

enum  RunState {
  Running,
  Stopping,
  Stopped
}
 Designed so that the Worker checks in with the Scheduler on his own terms; i.e. More...
 

Public Member Functions

 JWorker (JScheduler *scheduler, unsigned worker_id, unsigned cpu_id, unsigned domain_id, bool pin_to_cpu)
 
 JWorker (const JWorker &other)=delete
 If we copy or move the Worker, the underlying std::thread will be left with a dangling pointer back to this. More...
 
 JWorker (JWorker &&other)=delete
 
JWorkeroperator= (const JWorker &other)=delete
 
RunState get_runstate ()
 
void start ()
 
void request_stop ()
 
void wait_for_stop ()
 
void loop ()
 This is what the encapsulated thread is supposed to be doing.
 
void measure_perf (WorkerSummary &result)
 Summarize what/how this Worker is doing. More...
 

Public Attributes

JLogger logger
 The logger is made public so that somebody else may set it.
 

Member Enumeration Documentation

enum JWorker::RunState
strong

Designed so that the Worker checks in with the Scheduler on his own terms; i.e.

nobody will update the worker's assignment externally. This eliminates a whole lot of synchronization since we can assume that the Worker's internal state won't be updated by another thread. The Worker may be configured to try different backoff strategies

Constructor & Destructor Documentation

JWorker::JWorker ( const JWorker other)
delete

If we copy or move the Worker, the underlying std::thread will be left with a dangling pointer back to this.

So we forbid copying, assigning, and moving.

Member Function Documentation

void JWorker::measure_perf ( WorkerSummary result)

Summarize what/how this Worker is doing.

This is meant to be called from JProcessingController::measure_perf()

References loop().

Here is the call graph for this function:


The documentation for this class was generated from the following files: