From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA06998; Mon, 12 Aug 2002 19:24:18 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 TAA07127 for ; Mon, 12 Aug 2002 19:24:17 +0200 (MET DST) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g7CHOGf05637 for ; Mon, 12 Aug 2002 19:24:16 +0200 (MET DST) Received: from akasha.ijm.jussieu.fr (akasha.ijm.jussieu.fr [134.157.173.57]) by shiva.jussieu.fr (8.12.5/jtpda-5.4) with ESMTP id g7CHOFjR061791 for ; Mon, 12 Aug 2002 19:24:15 +0200 (CEST) Received: by akasha.ijm.jussieu.fr (Postfix, from userid 11004) id 249CB3C9E1; Mon, 12 Aug 2002 19:24:10 +0200 (CEST) From: Olivier Andrieu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15703.61241.869237.303066@akasha.ijm.jussieu.fr> Date: Mon, 12 Aug 2002 19:24:09 +0200 To: caml-list@inria.fr Subject: [Caml-list] Threaded C code and callbacks X-Mailer: VM 7.07 under Emacs 20.7.1 X-Antivirus: scanned by sophie at shiva.jussieu.fr Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, There's a C library I'd like to interface with ocaml but it is multithreaded. In the API, one can set some callbacks that are called asynchronously. Of course, I'd like these callbacks to be caml functions. The problem is that I cannot simply use `callback_exn' because when the callback is triggered another caml thread may be running ; callback_exn doesn't seem to check the mutex (or whatever) that guarantees that only one caml thread is running. I tried various hacks involving some mutex shared by caml and the C stub code but it stills crashes at some point. Any idea ? Or is this definitively impossible ? (I'm not very familiar with the internal's of ocaml's threading machinery). -- Olivier ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners