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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 2C7FCBB81 for ; Fri, 16 Dec 2005 14:28:35 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jBGDSYdL023944 for ; Fri, 16 Dec 2005 14:28:34 +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 OAA22695 for ; Fri, 16 Dec 2005 14:28:34 +0100 (MET) Received: from karpinski.uscs.susx.ac.uk (karpinski.uscs.susx.ac.uk [139.184.14.85]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jBGDSXdY016709 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 16 Dec 2005 14:28:34 +0100 Received: from calaf.rn.informatics.scitech.susx.ac.uk ([139.184.48.199]:53078) by karpinski.uscs.susx.ac.uk with esmtp (Exim 4.43) id IRLETC-000E84-37 for caml-list@inria.fr; Fri, 16 Dec 2005 13:29:36 +0000 Subject: Re: [Caml-list] Re: Concurrent and Distributed Programming in Ocaml From: David Teller Reply-To: David.Teller@ens-lyon.org To: caml-list@inria.fr In-Reply-To: References: <20051216115153.46672.qmail@web51613.mail.yahoo.com> Content-Type: text/plain Date: Fri, 16 Dec 2005 13:28:27 +0000 Message-Id: <1134739708.11220.24.camel@calaf.rn.informatics.scitech.susx.ac.uk> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-22) Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 43A2C102.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 43A2C101.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 ens-lyon:01 ocaml's:01 low-level:01 jocaml:01 compiler:01 cheers:01 threads:01 ocaml:01 abstraction:01 libref:01 wrote:01 wrote:01 simpler: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 While this module is absolutely great, it suffers from OCaml's limitation that multi-threaded code runs only one one processor, even if several are available. For concurrency, I would suggest taking a look at Acute, but that's quite low-level, when compared to JoCaml. Basically, the communication primitives are similar to a somewhat lower-level version of the Event module. I don't know whether there is a native code compiler, though. Cheers, David On Fri, 2005-12-16 at 13:40 +0100, Vincenzo Ciancia wrote: > Alexsandro Soares wrote: > > > Our first try used the > > primitives provided in modules Mutex and Condition to > > do syncronization between process and threads [...] we > > would like to use higher level constructs to work with > > concurrent and distributed programming. What are the > > options to do this in OCaml? > > I would recommend trying the Event module which features channels and > events, which in turn are an abstraction which allows to build more complex > events from simpler ones before "synchronizing" on the resulting event. > > For example, "receive a" is the event that, when you synchronize to it, > waits for a value to be sent on channel "a", and returns the value, and > "choose [receive a,receive b]" is the event that, when you synchronize to > it, waits for a value to be sent on either "a" or "b" and returns the value > - in this case a and b must have the same value type. > > http://caml.inria.fr/pub/docs/manual-ocaml/libref/Event.html > > Bye > > Vincenzo > -- Read, write and publish e-books, Free software, Open standards, Open source, The OpenBerg project -- http://www.openberg.org