Game Development Reference
In-Depth Information
To achieve maximum throughput for this game three frames of latency are needed:
×
TotalMemory = Latency
MemorySize(Frame)
Pipelining in a Task-Based Game A task-based system with the same constraints
can achieve full throughput with significantly less latency. Each system runs its
tasks on all cores. Running the systems in sequence means the entire taskset of A
must complete before B can run. Since the tasking system schedules B as soon as
A completes, the longest B has to wait to run after A completes is the length of
one task, where WaitTimeToStart(B) = TaskTime(A):
SetTime(A) = TaskTime(A)
×
TaskCount
/
NumberOfCPUs
,
Thislossofexecutiontimeisreferredtoasdrain-outtime. Figure17.8 shows
three tasksets executing in the tasking system. The white space is drain-out. The
calculation of execute time for this scenario, which has a latency of 1 is
ExecTime(Frame) = SetTime(A) + WaitTimeToStart(B , A) + SetTime(B)
+ WaitTimeToStart(C
,
B) + SetTime(C)
.
As the number of CPU cores increase, the thread-per-system cannot scale past
the number of systems while the task-based system can run concurrently on all
Figure 17.8. Three tasksets executing in the tasking system (task-based game).
 
Search WWH ::




Custom Search