Raven Engine v0.1
Loading...
Searching...
No Matches
Worker.h File Reference

Defines the Worker class which processes jobs from a job queue on its own thread. More...

#include "Raven/Job/JobQueue.h"
#include "Raven/Job/Job.h"
#include <atomic>
#include <thread>

Classes

class  Raven::Worker
 Background thread that fetches and executes jobs from a JobQueue. More...

Namespaces

namespace  Raven

Detailed Description

Defines the Worker class which processes jobs from a job queue on its own thread.

The Worker class encapsulates a single background thread that continuously polls a shared JobQueue for new jobs. When a job is available, the worker executes it by calling its Execute() method. If no jobs are pending, the worker yields to avoid busy-waiting. The worker can be started and stopped cleanly, ensuring the thread is joined on shutdown.

See also
JobQueue.h, ThreadPool.h
Author
PhilikusHD