3 ms·
> * How many bytes of register files does the OS have to save on task switches? (With this question, subregisters shouldn't be counted.) This is something that
by rbanffy 6y ago
> * How many bytes of register files does the OS have to save on task switches? (With this question, subregisters shouldn't be counted.)
This is something that has been bothering me for some time now - actually since the mid-80's: why not implement multiple contexts as an index into a large register file? This way, a context switch would take the time it takes to write to the `task-id` register. It will impact latencies, but would the impact of having, say, 8 contexts not be smaller than having to hit L1 or L2 for the same data?
- scottlamb 6y agoIsn't that (part of) what hyperthreads do?
- rbanffy 6y agoTrue, but at two per core (4 or 8 in more enlightened architectures), it's very meh. I would assume that, instead, a modern CPU tags decoded instructions in the reorder buffer with the virtual core number (and register set) it should be applied to. This way, the parallelism would be much easier to exploit.