Source

Thread

1/ @NOTimothyLottes

Working on the portable thread scheduling priority interface. Windows is a bit nicer by default, one can increase the scheduling priority without admin and there is a AvSetMmThreadCharacteristics() / AvSetMmThreadPriority() hack for “Pro Audio” scheduling needs.

2/ @NOTimothyLottes

Linux by default doesn’t allow any increase in scheduling priority. Users need to manually setup special user|group with elevated rights. Also system calls that try elevated scheduling don’t clamp, instead they fail -EPREM if out of bounds. So all around a pain in the ass.

3/ @NOTimothyLottes

I’m a little lazy right now and don’t feel like trying SteamOS big picture mode to see what the default ulimits are. Curious what they allow.

4/ @NOTimothyLottes

Linux priority workarounds
(a.) Use getrlimit() to get {soft,hard} limits
(b.) Use setrlimit() to set ‘soft=hard’ limit
(c.) Then set priority or nice based on new soft limit


5/ @NOTimothyLottes

I don’t do one-time global priority maximums, just in case someone sudo’s higher priority hard limit dynamically it should pickup the new limit.

6/ @NOTimothyLottes

Also while on setrlimit, I also bump up the RLIMIT_MEMLOCK to it’s maximum just in case before the mlockall().

Branches: 2026-07-01-mrsteyk1-on-my-install-the-limit-is-8m-even-vkcubes-usage