PhysX SDK 3.2 API Reference: pxtask::CpuDispatcher Class Reference

PhysX SDK 3.2 API

pxtask::CpuDispatcher Class Reference

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

#include <PxCpuDispatcher.h>

List of all members.


Public Member Functions

virtual void submitTask (BaseTask &task)=0
 Called by the TaskManager when a task is to be queued for execution.
virtual PxU32 getWorkerCount () const =0
 Returns the number of available worker threads for this dispatcher.
virtual ~CpuDispatcher ()

Detailed Description

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:
BaseTask

Task

TaskManager


Constructor & Destructor Documentation

virtual pxtask::CpuDispatcher::~CpuDispatcher (  )  [inline, virtual]


Member Function Documentation

virtual PxU32 pxtask::CpuDispatcher::getWorkerCount (  )  const [pure virtual]

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.

virtual void pxtask::CpuDispatcher::submitTask ( BaseTask task  )  [pure virtual]

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 when resource is available. After the task has been run, it should call the release() method and discard it's pointer.

Parameters:
[in] task The task to be run.
See also:
BaseTask


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



Copyright © 2008-2012 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com