From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 9ABFEBB9A for ; Tue, 15 Nov 2005 12:32:28 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jAFBWSee021778 for ; Tue, 15 Nov 2005 12:32:28 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA18559 for ; Tue, 15 Nov 2005 12:32:27 +0100 (MET) Received: from furbychan.cocan.org (furbychan.cocan.org [80.68.91.176]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jAFBWNOY025488 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 15 Nov 2005 12:32:26 +0100 Received: from rich by furbychan.cocan.org with local (Exim 3.35 #1 (Debian)) id 1EbzMU-0006WR-00; Tue, 15 Nov 2005 11:52:30 +0000 Date: Tue, 15 Nov 2005 11:52:30 +0000 To: xuzq Cc: caml-list@inria.fr Subject: Re: [Caml-list] Re: perl4caml crashed with threads Message-ID: <20051115115229.GA25002@furbychan.cocan.org> References: <20051114100945.GA20179@furbychan.cocan.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i From: Richard Jones X-Miltered: at nez-perce with ID 4379C74C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 4379C747.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 threads:01 threads:01 thread-safe:01 ocaml:01 threading:01 threading:01 ocaml:01 caml-list:01 notepad:01 ffe:98 wrote:01 inline:01 inline:01 unsafe:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Tue, Nov 15, 2005 at 02:03:20AM +0000, xuzq wrote: > Yes,it 's ok without threads and i see perl4caml may not be > thread-safe.I 'm only curious about why only "eval" crashes and > "call" looks fine.In my program another thread run the following > code without any error. I'm guessing that 'call' works by luck. I had a quick scan of the code and I can't see anything obviously unsafe. Since I never release the OCaml lock in any of the C code, surely the C calls are all serialised? It might also be that perl4caml_init is being called twice (from two threads) which would probably cause bad things to happen. A simple print statement should diagnose whether this is the case. To be honest, I'm not sure what the threading issues are when calling external C libraries. I rarely even use threading in OCaml, and as you probably guessed, I've never used it at all from perl4caml. > Thank you for your excellent perl4caml,Richard!Would it be possible for perl > to callocaml code just like the Inline::OCaml thoughts in that post: > http://caml.inria.fr/pub/ml-archives/caml-list/2002/02/e363d76f1e9b94779b1ffe7de3a7c011.en.html? Inline::OCaml would certainly be nice to have, but I don't have the time, or possibly even the skills, to write it. Rich. -- Richard Jones, CTO Merjis Ltd. Merjis - web marketing and technology - http://merjis.com Team Notepad - intranets and extranets for business - http://team-notepad.com