nn::nex::Scheduler::DispatchAll Member Function

Syntax

void DispatchAll();

Parameters

None.

Return Values

None.

Description

Executes all registered jobs.

If this function is called, all jobs registered in the scheduler execute until it is empty. If many jobs have been registered, there is a chance that a lot of CPU time will be consumed. To prevent fluctuations in the frame rate, use the Dispatch function, which can specify timeouts.

Make sure to call this function periodically. In order to keep latency (communication delay) to a minimum, we recommend that you configure a game loop according to the following sequence.

・Execute the DispatchAll or Dispatch function (for receiving)
・The application handles the received data. If you are using duplicated objects, refresh all duplicated object duplicas (apply the received data).
・Change the game state (physics calculations, AI, and so on).
・Set the data to send. If you are using duplicated objects, update all duplication masters (prepare to send data).
・Execute the DispatchAll or Dispatch function (for sending)
・The application performs rendering and other operations.

Careful attention is required when executing a process (such as loading a file while the screen display is off) that performs extreme blocking in the main thread. If execution of the main loop is delayed or job execution is not carried out, it will adversely affect the sending and receiving of messages. A determination that this is due to a timeout may be made as a result.

This function (as well as the Dispatch function) cannot be called by two threads at the same time.

Revision History

2011/05/09
Added mention that this function cannot be called from two threads at the same time.
2011/01/27
Initial version.

CONFIDENTIAL