Re: bus error when use threads and native mode on Mac
Olivier Andrieu <[email protected]> Fri, 17 Sep 2010 11:27:16 +0200
| Newsgroups | gmane.comp.lang.ocaml.lib.gtk |
|---|---|
| Message-ID | <[email protected]> |
Hi, On Fri, Sep 17, 2010 at 11:02, Yoann Padioleau <[email protected]> wrote: > Hi, > > I am trying to use threads in my lablgtk application but it crashes (I am on Mac OS) > in native mode with a mysterious "Bus Error". > I have linked my program with -thread and use > GtkThread.main (); > in the main but it does not work. It works nice in bytecode mode though. > > My program displays some fancy graphics with cairo and then run in the background using a thread > some heavy computation that I access on demand from the main thread when the user click > on certain things. > > My code also uses GMain.Idle and Gmain.Timeout (don't know if it's relevant). It might ! Timeout and idle callbacks have different rules than the usual widget event callbacks wrt. threading. cf. http://library.gnome.org/devel/gdk/stable/gdk-Threads.html#gdk-Threads.description « Idles, timeouts, and input functions from GLib, such as g_idle_add(), are executed outside of the main GTK+ lock. » -- Olivier