Multi threaded rendering
- From: "jupe" <jupenimo@xxxxxxxxxxx>
- Date: 27 Nov 2006 04:13:54 -0800
Hi,
I have written a multi-threaded motif app. The main thread creates the
user interface (just a few windows) and runs event processing as
usual. For each opened window there is one rendering thread, which
creates an opengl context through which it renders to its window.
window1 <--- ogl context1 <-- thread1
window2 <--- ogl context2 <-- thread2
......
Everything works fine (even on smp systems) as long as I create only
two windows. If I try to create a third window I get a crash with the
following message:
.../../../src/mesa/glapi/glapi.c:341: _glapi_get_dispatch: Assertion
`api != ((void *)0)' failed.
The crash happens in glXMakeCurrent() when the thread attemps to make
the created context the current context.
The very same multi-threading model works fine also on windows and mac
os x. Also if I replace opengl rendering with Xlib rendering, then I
can open any number of windows and it works rock solid.
So it seems this is an linux opengl specific issue.
I have googled with the above error message but haven't found anything
useful Instead, I found a few comments which suggested not to use
more than one rendering thread.
Anyway, all the docs say that glXMakeCurrent makes the context the
current context of the thread, so I don't think they added the "thread"
comment to the docs just for fun.
Has anyone tried to create opengl contexts from more one threads? Is
it even supposed to work?
All info on this would be highly appreciated.
Thanks!
.
- Prev by Date: Re: Signals and threads
- Next by Date: Re: Blocking read() from a USB->Serial adapter.
- Previous by thread: OT : emacs and ecb
- Next by thread: Pthread ThreadPool
- Index(es):
Relevant Pages
|