Delivered-To: garrigue at math.nagoya-u.ac.jp Authentication-Results: mailhost.math.nagoya-u.ac.jp sender=lablgtk-bounces at yquem.inria.fr; domainkey=neutral (no query protocol specified; no policy for yquem.inria.fr) Delivered-To: lablgtk at yquem.inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:mime-version :content-type:from:in-reply-to:date:cc:reply-to :content-transfer-encoding:message-id:references:to:x-mailer; bh=TWT2Cyrjst1XrCcapq1xXTKQ8E9XoEYlodyR0R2vz40=; b=YcFf4z/+fXc/YUbjxr51+foNrSS/swslBOcvUSrVpUW5XINApZbUJnyXF/RGvrhF6e 9yLnH5mpnCeSobz68FeJf+2D1b4Ut1zhx8xQjVxJT8f6U60K9hHeVYcyc8noERw6tnrt a4XVIGWY0XCADr8MvzrkFT61XNG4xcMxgh08Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :reply-to:content-transfer-encoding:message-id:references:to :x-mailer; b=q4mxzMmYzGFbcaWDIxUT7QZU0UWewD9x3FExe7hQH9eyS2/mbGFU77p797esHXeWjA ON2cHNhTBCpVUnar/JqmJIk+yXKTpv2NkgjsSfwikHvzw17ZTCWnpYL204yeci7zi6IB ygwQkCLFf9iMM1W8fDaG9dE5xEF7IVkZw4t5c= Subject: Re: [Lablgtk] bus error when use threads and native mode on Mac Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=iso-8859-1 From: Jacques Garrigue In-Reply-To: Date: Fri, 17 Sep 2010 20:01:34 +0900 Content-Transfer-Encoding: quoted-printable Message-Id: References: <2A3284AC-8CF8-40B6-9CD6-6240A2977A73 at facebook.com> To: Olivier Andrieu Cc: "lablgtk at yquem.inria.fr" , Yoann Padioleau Reply-To: garrigue at math.nagoya-u.ac.jp Status: U On 2010/09/17, at 18:27, Olivier Andrieu wrote: > Hi, >=20 > On Fri, Sep 17, 2010 at 11:02, Yoann Padioleau = wrote: >> Hi, >>=20 >> 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. >>=20 >> 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. >>=20 >> My code also uses GMain.Idle and Gmain.Timeout (don't know if it's = relevant). >=20 > 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.des= cription >=20 > =AB Idles, timeouts, and input functions from GLib, such as > g_idle_add(), are executed outside of the main GTK+ lock. =BB Actually, this shouldn't be relevant, as LablGTK does not use GTK+ = thread locking. It only uses the giant ocaml lock. But we may need more information on your program. Are you using Gtk+ on X11 or Quartz (the latter is much more picky with = threads)? What are all the versions (did you try with 2.14.2?) The difference between bytecode and native is intriguing. This maybe an ocaml problem, or just a problem triggerred by a = difference in scheduling. Jacques= _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk