From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 76276BB91 for ; Thu, 20 Jan 2005 19:58:54 +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 j0KIwrU2031847 for ; Thu, 20 Jan 2005 19:58:54 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA07709 for ; Thu, 20 Jan 2005 19:58:53 +0100 (MET) Received: from mail4.bluewin.ch (mail4.bluewin.ch [195.186.4.74]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j0KIwrrY031843 for ; Thu, 20 Jan 2005 19:58:53 +0100 Received: from [10.0.1.2] (83.76.249.3) by mail4.bluewin.ch (Bluewin AG 7.0.035) id 41E5802C000CB04D; Thu, 20 Jan 2005 18:58:53 +0000 In-Reply-To: <20050120182313.GB4919@quant3.janestcapital.quant> References: <20050120182313.GB4919@quant3.janestcapital.quant> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <4D24C0F4-6B15-11D9-9ECD-000393DBC266@epfl.ch> Content-Transfer-Encoding: 7bit Cc: caml-list caml-list From: =?ISO-8859-1?Q?Daniel_B=FCnzli?= Subject: Re: [Caml-list] C-threads & callbacks Date: Thu, 20 Jan 2005 19:58:41 +0100 To: Markus Mottl X-Mailer: Apple Mail (2.619) X-Miltered: at nez-perce with ID 41EFFF6E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41EFFF6D.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; epfl:01 caml-list:01 ocaml-code:01 ocaml's:01 myfun:01 val:01 ...:98 ...:98 callbacks:01 callbacks:01 thread:02 caml:02 caml:02 callback:02 unit:02 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: > As it seems, it is not possible to run OCaml-code linked with thread > support while letting C-threads perform callbacks. This has already > been a topic on the list a while ago. I don't understand what you are refering to. I don't think there's a problem as long as you take care to acquire ocaml's global lock to exectue the callbacks. #include ... caml_leave_blocking_section(); callback(*caml_named_value("myfun"), Val_unit); caml_enter_blocking_section(); ... This ensures that callbacks into caml are properly serialized. Daniel