Skip to content

Set idle priority for navmesh generation thread

elsid requested to merge elsid/openmw:thread_idle_priority into master

Add a function that uses corresponding functions from pthread on Linux and WinAPI on Windows. This should make framerate more stable and less affected by background navmesh generation. Proper measurements are still has to be done. But Linux the effect can be seen via perf by using cpulimit tool to set maximum allowed CPU usage for OpenMW. On my machine with cpulimit -p $(pidof openmw) -l 100 with idle priority for navmesh generation thread CPU usage by this thread is reduced from 58% to 27%. And CPU usage pattern is different (see selected thread):

Default priority: default

Idle priority: sched_idle

Merge request reports