Re: Is Volumizer thread safe

New Message Reply Date view Thread view Subject view Author view

Andy (avesper@wn.net)
Thu, 06 May 1999 18:29:25 -0400


Robert Grzeszczuk wrote:

> Indeed. "Thy shall not have two threads accesing a single context" is a rule
> to live by in OpenGL world.

The various OpenGL/window glue facilities (i.e. glXMakeCurrent,
wglMakeCurrent, etc.) will not allow this. If a context is current to thread
A, thread B will get an error if it tries to make that context current.

Multi-threaded OpenGL programs are rather a bear to get working.
First, note that many X11/OpenGL implementations are not multi-thread
safe. (NT/OpenGL implemenations are required to be, but are they?)
Second, glXSwapBuffers and NT's SwapBuffer are required to
synchronize with the current thread's OpenGL context (if any), but are
not required to synchronize with any other random context that might
be current to some other thread.

If you are sharing display lists and texture objects, note that display
lists must change atomically at the glEndList () call. Texture objects
have no such requirement; it is up to the application to ensure correct
synchronization.

Andy V


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Nov 01 1999 - 13:42:00 PST