|
JPH_OVERRIDE_NEW_DELETE | JobSystemThreadPool (uint inMaxJobs, uint inMaxBarriers, int inNumThreads=-1) |
|
| JobSystemThreadPool ()=default |
|
virtual | ~JobSystemThreadPool () override |
|
void | Init (uint inMaxJobs, uint inMaxBarriers, int inNumThreads=-1) |
|
virtual int | GetMaxConcurrency () const override |
| Get maximum number of concurrently executing jobs. More...
|
|
virtual JobHandle | CreateJob (const char *inName, ColorArg inColor, const JobFunction &inJobFunction, uint32 inNumDependencies=0) override |
|
void | SetNumThreads (int inNumThreads) |
| Change the max concurrency after initialization. More...
|
|
JPH_OVERRIDE_NEW_DELETE | JobSystemWithBarrier (uint inMaxBarriers) |
|
| JobSystemWithBarrier ()=default |
|
virtual | ~JobSystemWithBarrier () override |
|
void | Init (uint inMaxBarriers) |
|
virtual Barrier * | CreateBarrier () override |
| Create a new barrier, used to wait on jobs. More...
|
|
virtual void | DestroyBarrier (Barrier *inBarrier) override |
| Destroy a barrier when it is no longer used. The barrier should be empty at this point. More...
|
|
virtual void | WaitForJobs (Barrier *inBarrier) override |
| Wait for a set of jobs to be finished, note that only 1 thread can be waiting on a barrier at a time. More...
|
|
virtual | ~JobSystem ()=default |
| Destructor. More...
|
|
virtual int | GetMaxConcurrency () const =0 |
| Get maximum number of concurrently executing jobs. More...
|
|
virtual JobHandle | CreateJob (const char *inName, ColorArg inColor, const JobFunction &inJobFunction, uint32 inNumDependencies=0)=0 |
|
virtual Barrier * | CreateBarrier ()=0 |
| Create a new barrier, used to wait on jobs. More...
|
|
virtual void | DestroyBarrier (Barrier *inBarrier)=0 |
| Destroy a barrier when it is no longer used. The barrier should be empty at this point. More...
|
|
virtual void | WaitForJobs (Barrier *inBarrier)=0 |
| Wait for a set of jobs to be finished, note that only 1 thread can be waiting on a barrier at a time. More...
|
|
| NonCopyable ()=default |
|
| NonCopyable (const NonCopyable &)=delete |
|
void | operator= (const NonCopyable &)=delete |
|
Implementation of a JobSystem using a thread pool
Note that this is considered an example implementation. It is expected that when you integrate the physics engine into your own project that you'll provide your own implementation of the JobSystem built on top of whatever job system your project uses.