PxCpuDispatcher

Defined in include/task/PxCpuDispatcher.h

Inheritance Relationships

Derived Type

class PxCpuDispatcher

A CpuDispatcher is responsible for scheduling the execution of tasks passed to it by the SDK.

A typical implementation would for example use a thread pool with the dispatcher pushing tasks onto worker thread queues or a global queue.

See also

PxBaseTask

See also

PxTask

See also

PxTaskManager

Subclassed by PxDefaultCpuDispatcher

Public Functions

virtual void submitTask(PxBaseTask &task) = 0

Called by the TaskManager when a task is to be queued for execution.

Upon receiving a task, the dispatcher should schedule the task to run. After the task has been run, it should call the release() method and discard its pointer.

See also

PxBaseTask

Parameters

task[in] The task to be run.

virtual uint32_t getWorkerCount() const = 0

Returns the number of available worker threads for this dispatcher.

The SDK will use this count to control how many tasks are submitted. By matching the number of tasks with the number of execution units task overhead can be reduced.

inline virtual ~PxCpuDispatcher()