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 8EC43BB83 for ; Fri, 12 May 2006 02:29:15 +0200 (CEST) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.172]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k4C0TF7J008412 for ; Fri, 12 May 2006 02:29:15 +0200 Received: by ug-out-1314.google.com with SMTP id e2so218754ugf for ; Thu, 11 May 2006 17:29:15 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type; b=SmZKRG0CR7ecZfpWAa4ItrIhYs2Fqv/u6Je5KcGHMajLg75vmCken4bu5WhWk2wPx1jAI+EpR5igwsp03flXz2PX5ER/wOKVym2y7XLyxRR8gC8JkUjPmumVpNplCkOqLI3beDCI8KX05JIViCALoldLtO4TCSwWAtlgxYUcoPk= Received: by 10.78.58.11 with SMTP id g11mr340077hua; Thu, 11 May 2006 17:29:15 -0700 (PDT) Received: by 10.78.53.2 with HTTP; Thu, 11 May 2006 17:29:14 -0700 (PDT) Message-ID: Date: Thu, 11 May 2006 17:29:14 -0700 From: "Francois Rouaix" Reply-To: francois@rouaix.org To: caml-list@yquem.inria.fr Subject: Co-existing with non OCaml threads MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_18605_17592927.1147393754984" X-j-chkmail-Score: MSGID : 4463D6DB.000 on nez-perce : j-chkmail score : X : 0/20 1 X-Miltered: at nez-perce with ID 4463D6DB.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 threads:01 ocaml:01 threads:01 interfacing:01 --f:01 interfacing:01 --f:01 native:02 native:02 caml:02 caml:02 francois:02 francois:02 library:03 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=HTML_00_10,HTML_MESSAGE, RCVD_BY_IP autolearn=disabled version=3.0.3 ------=_Part_18605_17592927.1147393754984 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I'm contemplating writing an OCaml interface for a C++ middleware library that my company develops and uses internally. Typically this middleware wil= l start an event loop on a thread in the background, leaving the application responsible for its own threads (and potentially using none and having its own code running entirely on events within the eventloop thread). How's this likely to be compatible with OCaml use of native threads (this i= s on Linux by the way)? The manual section for interfacing with C isn't mentionning threads anywhere. Should Caml code be restricted to run on threads it has created? Or can it run on any threads? How can I synchronize between a thread running C++ code and a thread runnin= g OCaml code (i.e. both communicating on a message queue)? Thanks for any suggestions. --f ------=_Part_18605_17592927.1147393754984 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I'm contemplating writing an OCaml interface for a C++ middleware library t= hat my company develops and uses internally. Typically this middleware will= start an event loop on a thread in the background, leaving the application= responsible for its own threads (and potentially using none and having its= own code running entirely on events within the eventloop thread).
How's this likely to be compatible with OCaml use of native threads (th= is is on Linux by the way)?
The manual section for interfacing with C is= n't mentionning threads anywhere.
Should Caml code be restricted to run = on threads it has created? Or can it run on any threads?
How can I synchronize between a thread running C++ code and a thread ru= nning OCaml code (i.e. both communicating on a message queue)?
Thanks fo= r any suggestions.
--f

------=_Part_18605_17592927.1147393754984--