[SDL] (openGL repaint) thread problem

Mattias Engdegård f91-men at nada.kth.se
Fri Aug 10 07:26:00 PDT 2001


Johann Deneux <johannd at DoCS.UU.SE> wrote:
>I know for sure using threads with the Xlib is in general dangerous. That
>means using anything that uses the Xlib is trickt too: Qt, gtk, OpenGL,
>SDL...

Xlib is thread-safe if you follow the rules in the Xlib docs, and you
may call Xlib functions from different threads if you are careful.
SDL is not thread-safe in that respect, so never use the SDL API from
any other thread than the main thread. (Also avoid SDL functions in
callbacks.)

The chief exception is SDL_PushEvent() (and I think we can safely proclaim
SDL_GetTicks to be safe as well)







More information about the SDL mailing list