Home › Forums › Syphon › Syphon Development – Developer › Grey Screen of Death › Reply To: Grey Screen of Death
Thats not quite correct –
OpenGL access has to be *serialized* – meaning you cannot make concurrent requests to OpenGL from multiple threads, as you will corrupt the command stream submitted to the GPU, and cause issues.
OpenGL is a state machine, you twiddle state on and off and submit objects, and then render at the current configuration. Changes you make persist, and order of operations matter.
So in terms of multithreading OpenGL, you have to serialize access to a OpenGL Context.
Something like
Thread A:
Lock for OpenGL
Draw / Resize Viewport
Render/ Flush the screen
Unlock for OpenGL
Thread B:
Do something to prepare expensive calculations for OpenGL
Lock for OpenGL
Submit OpenGL Commands
Unlock OpenGL
Continue on your way
Hope that helps.