On Thu, 2008-09-25 at 09:16 +0100, Emmanuele Bassi wrote:
> and while GLib data structures and MainLoop are usually thread safe,
> GType instantiation is not entirely thread safe (try creating two new
> instances of the same class from the same thread).

I don't think the threading issues are so much of a problem for this
simple case of calling glXSwapBuffers in a second thread. It creates one
single extra thread which doesn't invoke any callbacks, call object
methods nor create any objects. It only locks a mutex, waits to be woken
up via a GCondition and calls glXSwapBuffers in a loop. Once the swap is
completed it calls g_main_context_wakeup. I believe the wakeup is
performed by sending a byte on a pipe to the main thread. So all event
handling and painting is still handled by the thread that calls
clutter_main.

Currently, the extra thread is only created if you call g_thread_init so
it won't affect apps that don't ask for it.

- Neil

-- 
To unsubscribe send a mail to [EMAIL PROTECTED]

Reply via email to