3 ms·
Make a syscall for io. Now the kernel takes over and runs whatever it likes for as long as it likes. Do no syscalls. Timer tick. Kernel takes over and does wha
by harry8 2y ago
Make a syscall for io. Now the kernel takes over and runs whatever it likes for as long as it likes.
Do no syscalls. Timer tick. Kernel takes over and does whatever as well.
No_HZ_FULL, isolated cpu cores, interrupts on some other core and you can spin using 100% cpu forever on a core. Do games do anything like this?
- biorach 2y agoPinning on a core like this is done in areas like HPC and HFT. In general you want a good assurance that your hardware matches your expectations and some kernel tuning. I haven't heard of it being done with PC games. I doubt the environment would be predictable enough. On consoles tho..?
- chainingsolid 2y agoThinking about it the threads in a game that normally need more CPU time are the ones that are doing lots of sys calls. You'd have to use a fair bit of async and atomics, to split the work into compute and chatting with the kernal. Might as well figure out how to do it 'right' and use 2+ threads so it can scale. Side note the compute heavy low sys call freqency stuff like terrain gen belongs in the pool of back ground threads, normaly.
- vvanders 2y agoWe absolutely pinned on consoles, anywhere where you have fixed known hardware tuning for that specific hardware usually nets you some decent benefits. From what I recall we mostly did it for predictability so that things that may go long wouldn't interrupt deadline sensitive things(audio, physics, etc).
- biorach 2y agoNice, thank you