TLDR you might be interested in the rust-based scheduler one of the Canonical Devs released as a PoC. Seemed to be designed similar to your needs of keeping the system (particularly games) responsive even whilst running heavy tasks like kernel compilations. You can swap out schedulers at run time on Linux iirc?
https://www.phoronix.com/news/Rust-Linux-Scheduler-Experiment
I like watching DF but imo it might not be everyone’s cup of tea. It’s probably the best game I’ll never play