Viewing a single comment thread. View all comments

Sneak-Scope t1_j6lrgbb wrote

It's been a minute, but is this just incorrect? The CPU is much worse at task switching than the GPU.

The CPU is meant to be a generalist and so is bereft the purpose built hardware to excel at anything. Where the GPU is built to slam numbers together in a disgustingly parallel fashion.

I have been in airports for twenty hours now so I'm sorry if that's wrong!

10

ExtremelyGamer1 t1_j6mh9z7 wrote

Yes you’re right the GPU is better at task switching which is why it is good at parallel tasks. It can switch between threads so that it never has to wait too long on it to finish.

5

psycotica0 t1_j6mmonh wrote

I think it depends on what they meant by task switching. I think they meant "do a bit of game, then do a bit of web browser, then read some files, then back to game".

The GPU is good at doing the same "task", but a billion times, often with a huge amount of parallelism. So it's obviously good at switching from doing that task on one thing to doing that task on the next thing, but in the end it's still the same task.

4

Sneak-Scope t1_j6nptjl wrote

I guess so, though I think it's being used wrong in that context. In the context of CPU/GPU, 'task switching' describes the hardware's ability to park a thread and start a different one executing.

In the case of the CPU, it has to dump cache to main memory, load new information and continue. Where the GPU, usually, is just like 'lol pause play!'

2

TheSkiGeek t1_j6p44cp wrote

That’s because GPUs don’t really cache anything, they’re running a program that streams data from one part of VRAM, transforms it, and writes it back to another part of VRAM.

If the OS wants to change what the CPU is doing it just jumps it to another block of code in RAM. Programs can spin up their own threads in real time. With a GPU there’s a whole process that has to be gone through to load or unload shaders, map and allocate VRAM, etc. — it’s much less flexible, and the latency of swapping from one kind of calculation to another is much higher.

2