5 ms·
Just because a game uses threads does not mean it can magically get rid of Amdahl's law. The CPU workload of games does not scale anything like compilation.
by anfilt 6y ago
Just because a game uses threads does not mean it can magically get rid of Amdahl's law. The CPU workload of games does not scale anything like compilation.
- zamalek 6y ago> does not mean it can magically get rid of Amdahl's law. Neither can compilation.
- anfilt 6y agoI never claimed it did. Compilation is an embarrassingly parallel task. This means you can increase the number of threads by a much much larger amount before you hit Amdahl's law. That is not true for video games unless you count what runs on GPUs. Not only can it be less obvious on what to parallelize in a game engine. You quickly start to see the parallel slowdown/diminishing returns in game engines. Further, not every thread in video game is going to use the CPU at 100%, a lot them will be waiting on IO, and not using any time slices till that IO task is finished. Games do not scale like compilation, it does not matter what engine or how new that engine is. https://en.wikipedia.org/wiki/Embarrassingly_parallel https://en.wikipedia.org/wiki/Embarrassingly_parallel https://en.wikipedia.org/wiki/Parallel_slowdown https://en.wikipedia.org/wiki/Parallel_slowdown
- zamalek 6y ago> Further, not every thread in video game is going to use the CPU at 100% Modern game engines do not segregate work according to threads, they use thread pools. If one green thread is busy with I/O, work can be scheduled on its OS thread. https://en.wikipedia.org/wiki/Work_stealing https://en.wikipedia.org/wiki/Work_stealing