PxDefaultCpuDispatcherCreate

Defined in include/extensions/PxDefaultCpuDispatcher.h

PxDefaultCpuDispatcher *PxDefaultCpuDispatcherCreate(PxU32 numThreads, PxU32 *affinityMasks = NULL, PxDefaultCpuDispatcherWaitForWorkMode::Enum mode = PxDefaultCpuDispatcherWaitForWorkMode::eWAIT_FOR_WORK, PxU32 yieldProcessorCount = 0)

Create default dispatcher, extensions SDK needs to be initialized first.

Note

numThreads may be zero in which case no worker thread are initialized and simulation tasks will be executed on the thread that calls PxScene::simulate()

Note

yieldProcessorCount must be greater than zero if eYIELD_PROCESSOR is the chosen mode and equal to zero for all other modes.

Note

eYIELD_THREAD and eYIELD_PROCESSOR modes will use compute resources even if the simulation is not running. It is left to users to keep threads inactive, if so desired, when no simulation is running.

Parameters
  • numThreads[in] Number of worker threads the dispatcher should use.

  • affinityMasks[in] Array with affinity mask for each thread. If not defined, default masks will be used.

  • mode[in] is the strategy employed when a busy-wait is encountered.

  • yieldProcessorCount[in] specifies the number of times a OS-specific yield processor command will be executed during each cycle of a busy-wait in the event that the specified mode is eYIELD_PROCESSOR