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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 0412ABBAF for ; Thu, 15 Jul 2010 20:24:17 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkQCAKfuPkzZSMDqkWdsb2JhbACfbBUBAQEBCQsKBxEDH79LhSQE X-IronPort-AV: E=Sophos;i="4.55,209,1278280800"; d="scan'208";a="55612377" Received: from fmmailgate03.web.de ([217.72.192.234]) by mail2-smtp-roc.national.inria.fr with ESMTP; 15 Jul 2010 20:24:16 +0200 Received: from smtp03.web.de ( [172.20.0.65]) by fmmailgate03.web.de (Postfix) with ESMTP id 2889215B79CB3; Thu, 15 Jul 2010 20:24:16 +0200 (CEST) Received: from [78.43.204.177] (helo=frosties.localdomain) by smtp03.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #4) id 1OZT6V-0002a5-00; Thu, 15 Jul 2010 20:24:16 +0200 Received: from mrvn by frosties.localdomain with local (Exim 4.72) (envelope-from ) id 1OZT6V-0006td-9w; Thu, 15 Jul 2010 20:24:15 +0200 From: Goswin von Brederlow To: Rich Neswold Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Smart ways to implement worker threads References: <87sk3mcaeq.fsf@frosties.localdomain> Date: Thu, 15 Jul 2010 20:24:15 +0200 In-Reply-To: (Rich Neswold's message of "Thu, 15 Jul 2010 10:58:23 -0500") Message-ID: <87zkxsfvsg.fsf@frosties.localdomain> User-Agent: Gnus/5.110009 (No Gnus v0.9) XEmacs/21.4.22 (linux, no MULE) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: goswin-v-b@web.de X-Sender: goswin-v-b@web.de X-Provags-ID: V01U2FsdGVkX18Q/T3x1iZUTPhRn2MRzbxYHmHAmiKQndhd8+4K SZJTf/S2zEM5mW1HLBgMHWWQHyEa21m3RtKneOd1P4l4ez+g0d kg+MCUylI= X-Spam: no; 0.00; model:01 mutexes:01 threading:01 threading:01 lear:01 ocaml:01 ocaml:01 mfg:98 threads:01 wrote:01 caml-list:01 short:01 writes:01 constraints:03 constraints:03 Rich Neswold writes: > On Wed, Jul 14, 2010 at 11:09 AM, Goswin von Brederlow > wrote: > > 4) Do some magic with Event.t? > > Problem: never used this and I could use a small example how to use > this. > > > Event.t (and its associated library) *is* magical in that it provides an > absolutely beautiful concurrent programming model. Forget about select() and > mutexes and other ugly threading concepts. Event.t and friends is how it should > be done. > > John H. Reppy's "Concurrent Programming in ML" provides a thorough > understanding of how to use this module effectively. This book presents the > material in a very understandable way: deficiencies in current threading > models are discussed as well as how CML solves the limitations and constraints. > The book can be purchased or downloaded free online. It is too bad I don't want to lear CML but use Ocaml. The CML examples from the book don't translate into ocaml since the interface is just a little bit different and those differences are what throws me off. I figue spawn becomes Thread.cread and I have to add Event.sync or Event.select and Event.wrap at some points. At which point the book becomes useless to understanding how Ocamls Event module is to be used I'm afraid. Also doesn't tell me what Ocamls limitations and constraints are. So if you have used this in ocaml could you give a short example? E.g. the merge sort from the book. MfG Goswin