SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL(3)

πŸ’… NAME

SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL β€” bestie, this hint tells SDL whether SDL_THREAD_PRIORITY_TIME_CRITICAL should be treated as realtime. That's it, that's the whole job. πŸ‘‘


✨ SYNOPSIS ✨

#include <SDL3/SDL_hints.h>

#define SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL "SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL"

🧚 DESCRIPTION 🧚

okay so, plot twist: on some platforms (looking at you, Linux πŸ’€), a realtime priority thread can get hit with restrictions that your app has to handle itself, like, specially. This hint exists so SDL knows you, the app, are prepared to deal with said restrictions. It's giving "i got this, trust." 🫢

On Linux, SDL will apply the following configuration to any thread that becomes realtime:

  • The SCHED_RESET_ON_FORK bit will be set on the scheduling policy,
  • An RLIMIT_RTTIME budget will be configured to the rtkit specified limit.
  • Exceeding this limit will result in the kernel sending SIGKILL to the app, refer to the man pages for more information.
not the kernel just ending your whole app with SIGKILL no cap 😭 that's a whole assassination, fr fr. go read the man pages, bestie.

The variable can be set to the following values:

  • "0": default platform specific behaviour
  • "1": Force SDL_THREAD_PRIORITY_TIME_CRITICAL to a realtime scheduling policy

This hint should be set before calling SDL_SetCurrentThreadPriority()


🌈 AVAILABILITY 🌈

This hint is available since SDL 3.2.0. ✨


mwah πŸ’– that's the whole page, you ate it, periodt. this lil' legend came to you from the fine folks at Simple Directmedia Layer, shipping with SDL 3.4.18 β€” go forth and schedule responsibly, queen. πŸŽ€πŸ¦‹πŸ‘‘

πŸ“¦ where this page comes from