On Mon Feb 17 15:58:41 2025 +0000, Rémi Bernon wrote:
I don't really know about macOS, but I don't think implementing realtime priorities is a good idea. At least on Linux I would advise against it (and it needs specific permission anyway). It's IMO putting the system at a higher risk of becoming unresponsive in case of bogus or rogue application.
The only thing needed on macOS to get a thread into the realtime band is the thread port, and asking the scheduler for reasonable time constraints.
In my experience even putting an entire game in the realtime band works fairly well (some threads get demoted though after a while); the performance is slightly worse though than staying in the high application band. Putting taskmgr into the realtime band makes it stay there indefinitely with no issues AFAICT too.
System responsiveness was also still fine, at least in my testing. It is also soft-realtime and during very high system load threads get put back to where they originally were relatively quickly (especially when not adhering to their computation constraints), which is probably why the API is so lax with permissions.