SDL_HINT_THR...IORITY_POLICY(3)
π SDL_HINT_THREAD_PRIORITY_POLICY π
okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_HINT_THREAD_PRIORITY_POLICY β a string that carries extra info you wanna hand over to SDL_SetCurrentThreadPriority. that's the whole vibe. let's get into it π«Ά
β¨ NAME β¨
SDL_HINT_THREAD_PRIORITY_POLICY β a string specifying additional information to use with SDL_SetCurrentThreadPriority. literally just a little note you pass along so SDL knows how you want your thread priority situation handled π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_hints.h>
#define SDL_HINT_THREAD_PRIORITY_POLICY "SDL_THREAD_PRIORITY_POLICY"
π¦ DESCRIPTION π¦
so here's the tea π by default, SDL_SetCurrentThreadPriority is gonna make all the appropriate system changes on its own to apply a thread priority. like, on systems using pthreads, the scheduler policy gets changed automatically to a policy that works well with whatever priority you asked for. no cap, it just handles it.
but if your code has specific requirements β like, very particular needs β you can override SDL's default behavior with this hint. that's the moment to speak up, bestie π
for pthread, the hint values are "current", "other", "fifo" and "rr". currently no other platform hint values are defined β but they may be in the future, so stay tuned i guess π
β οΈ on Linux, the kernel may sendSIGKILLto realtime tasks which exceed the distro configured execution budget for rtkit. this budget can be queried throughRLIMIT_RTTIMEafter callingSDL_SetCurrentThreadPriority(). yes that's a real thing and yes it will absolutely end your little thread's whole career π
π also super important: this hint should be set before calling SDL_SetCurrentThreadPriority(). set it late and it's givingβ¦ nothing. order matters, periodt.
π AVAILABILITY π
this hint is available since SDL 3.2.0. so if you're on anything older, it's not here yet bestie, sorry π
that's the page!! brought to you by the fine folks at Simple Directmedia Layer, living in SDL 3.4.18, filed under SDL_HINT_THR...IORITY_POLICY(3) in the SDL3 FUNCTIONS girlies. go set your hints before you call the function, mwah πβ¨
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms