|
ReplicaNet and RNLobby
1
|
#include <JobManager.h>


Public Member Functions | |
| JobManager () | |
| virtual | ~JobManager () |
| void | SetPoolSize (const size_t poolSize=PlatformInfo::GetNumberOfCores()) |
| bool | Start (void) |
| bool | Stop (void) |
| bool | AddPoolJob (Job *job) |
| int | CancelJobs (void *const job) |
Public Member Functions inherited from ThreadClass | |
| ThreadClass () | |
| virtual | ~ThreadClass () |
| void | Sleep (int milliseconds) |
Public Member Functions inherited from MutexClass | |
| MutexClass () | |
| virtual | ~MutexClass () |
| void | Lock (void) |
| void | UnLock (void) |
Public Member Functions inherited from Thread | |
| Thread () | |
| virtual | ~Thread () |
| void | Begin (ThreadClass *threaded_class) |
| void | Terminate (void) |
| bool | GetTerminated (void) |
| bool | GetEverTerminated (void) |
| bool | GetIsRunning (void) const |
| void | SetPreferredProcessor (int processor=kReplicaNetPreferredProcessorOSChoice) |
| int | GetPreferredProcessor (void) |
Additional Inherited Members | |
Public Types inherited from MutexClass | |
| enum | { kNoOwnerThread = -1 } |
Static Public Member Functions inherited from Thread | |
| static int | CallThreadEntry (ThreadClass *thread_class) |
| static int | GetCurrentProcessorNumber (void) |
| static size_t | GetNumAllocated (void) |
| static size_t | GetNumActive (void) |
Protected Member Functions inherited from ThreadClass | |
| void | DoQuitNow (const int returnCode) |
| void | CheckQuit (void) |
Static Protected Member Functions inherited from ThreadClass | |
| static size_t | GetNumAllocated (void) |
This JobManager class handles pool of threads that queue and run jobs.
| JobManager | ( | ) |
The ctor performs some basic initialisation
|
virtual |
The dtor makes sure the entire job queue is terminated.
| bool AddPoolJob | ( | Job * | job | ) |
Queues a jobs to run. If PlatformInfo::IsThreaded() returns false then AddPoolJob() will immediately run the job and return. Once the Job finishes running then it is automatically deleted. Before Job::Run() finishes the user should call out to save important Job data, or communicate the results of a calculation.
1.8.6