From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 1CD3ABC69 for ; Tue, 10 Apr 2007 04:41:51 +0200 (CEST) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l3A2fn67004247 for ; Tue, 10 Apr 2007 04:41:50 +0200 Received: from localhost (orion [130.54.16.5]) by kurims.kurims.kyoto-u.ac.jp (8.13.7/8.13.7) with ESMTP id l3A2fm1p025360; Tue, 10 Apr 2007 11:41:48 +0900 (JST) Date: Tue, 10 Apr 2007 11:41:42 +0900 (JST) Message-Id: <20070410.114142.108305770.garrigue@math.nagoya-u.ac.jp> To: skaller@users.sourceforge.net Cc: shawjef3@msu.edu, caml-list@inria.fr Subject: Re: [Caml-list] crash under macos x but not win32 From: Jacques Garrigue In-Reply-To: <1176170937.5747.24.camel@rosella.wigram> References: <20070410.100759.08076654.garrigue@math.nagoya-u.ac.jp> <1176170937.5747.24.camel@rosella.wigram> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 461AF96D.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; macos:01 callable:01 threads:01 ocaml:01 ocaml:01 osx:01 sourceforge:01 wrote:01 caml-list:01 functions:01 reentrant:02 caml:02 graphics:02 garrigue:03 garrigue:03 From: skaller > On Tue, 2007-04-10 at 10:07 +0900, Jacques Garrigue wrote: > > From: "Jeffrey Loren Shaw" > > > Rather, it appears not > > to be reentrant (or rather not callable from several threads.) By the > > way I am surprised you have no problem under Win32, which often has > > reentrance problems too. > > Tcl is re-entant since version 8. Tk is not and never will be. Actually this is not the problem here, as ocaml does not need full reentrance (ability to call the library after preemption), but just a weaker form (ability to call the library from any thread, after control was given back to the ocaml process). This is because only one ocaml thread runs at any time, and only when the control is on the caml side. So I believe the problem is at a lower level, either in the system's graphics libraries (I'm no OSX specialist), or in the specifics of the Tk/Aqua implementation. For instance, on windows, GDI functions must always be called from the same thread or you get an error. Jacques Garrigue