[SDL] (openGL repaint) thread problem

David Olofson david.olofson at reologica.se
Wed Aug 8 03:38:01 PDT 2001

On Tuesday 07 August 2001 21:13, Johannes Schmidt wrote:
> Hi,
> I have some problems using threads.
> If I try to do some drawing stuff in a thread created with
> SDL_CreateThread, the application exits with
> Fatal signal: Segmentation Fault (SDL Parachute Deployed)
> Xlib: unexpected async reply (sequence 0x66)!
> If I do the same drawing within the main thread, the application runs
> as expexted.

The SDL graphics calls aren't thread safe. (Although it probably could be 
without too many API changes. However, it's not trivial to implement that 
without performance issues.) Nor are the underlying protocols, X and GLX.

As to OpenGL, think about it; how could a state machine style API like 
OpenGL possibly be thread safe..? (Oh well, every library call could 
check which thread is running upon entry, but that wouldn't exactly help 
performance! :-)

//David Olofson --- Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
|      Multimedia Application Integration Architecture      |
| A Free/Open Source Plugin API for Professional Multimedia |
`----------------------> http://www.linuxaudiodev.com/maia -'
.- David Olofson -------------------------------------------.
| Audio Hacker - Open Source Advocate - Singer - Songwriter |
`--------------------------------------> david at linuxdj.com -'

More information about the SDL mailing list