Re: GlGtk + Thread?

Matthieu Dubuget <[email protected]>
Newsgroups gmane.comp.lang.ocaml.lib.gtk
Message-ID <[email protected]>
Jacques Garrigue a écrit :

> I'm not sure of the reason, but it probably means that GL doesn't like
> to be called from different threads. Usually this problem of calling
> threads rather happens on windows, but apparently with GL this is the
> case for Unix too. The solution is to look at the explanations in
> GtkThread.mli, and issue all GL related calls through GtkThread.sync
> or GtkThread.async.
> Note that of course all calls directly from callbacks should be safe
> without wrappers, since they are called from the GUI thread
> themselves.
> 
> Tell us whether it solves your problem.

Thanks for your answer. Unfortunately, it did not work.

I tried to insert sync calls, but could not find where to put them:

The first GL related function is GlGtk.area. But it would seem strange
to call this function through GtkThread.sync? It is in the main thread,
isn't it?

All the other calls are from callbacks.

The GlGtk-WARNING is displayed when the "display" callback is called only.

Even if this callback is a void function.

If I suppress the area#connect#display call, the warning disappears, but
 when the program end, there is a segmentation error.

Salutations

Matthieu
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.