From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.5 required=5.0 tests=AWL,BANG_GUAR, DNS_FROM_RFC_ABUSE,SPF_NEUTRAL autolearn=disabled version=3.1.3 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 B3E68BB83 for ; Sat, 26 Aug 2006 00:19:39 +0200 (CEST) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.234]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k7PMJcl1003680 for ; Sat, 26 Aug 2006 00:19:39 +0200 Received: by wx-out-0506.google.com with SMTP id s6so1036428wxc for ; Fri, 25 Aug 2006 15:19:38 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=FA2d+reFHe2FRJl61LKdCcJ68x7oEpjSTkictVDEVa5RhpbTd14dAtsWgvtl4JBHe0W6X5EHAECsCfdQ0dTrfSJcYDTc33yHiuBgLi/736rTLRO45d83lNc/RD/njICierORjkpdzFTiYEeQWODrHzwqZMJFzXh+eXmlaXDQzoI= Received: by 10.90.25.3 with SMTP id 3mr792023agy; Fri, 25 Aug 2006 15:19:38 -0700 (PDT) Received: by 10.90.106.19 with HTTP; Fri, 25 Aug 2006 15:19:38 -0700 (PDT) Message-ID: Date: Fri, 25 Aug 2006 15:19:38 -0700 From: "Nathaniel Gray" To: skaller Subject: Re: [Caml-list] Re: Select on channels (again) Cc: "Jacques Garrigue" , caml-list@yquem.inria.fr In-Reply-To: <1156470934.20759.166.camel@rosella.wigram> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20060822.172138.82692882.garrigue@math.nagoya-u.ac.jp> <1156314944.7834.46.camel@rosella.wigram> <1156397869.16998.122.camel@rosella.wigram> <1156470934.20759.166.camel@rosella.wigram> X-j-chkmail-Score: MSGID : 44EF777A.000 on nez-perce : j-chkmail score : X : 0/20 1 X-Miltered: at nez-perce with ID 44EF777A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 cheers:01 sourceforge:01 wrote:01 parsed:01 caml-list:01 pthreads:02 pthreads:02 objects:02 module:03 library:03 blocking:04 blocking:04 limitations:04 caltech:05 On 8/24/06, skaller wrote: > > The thing is, you can already do this, guaranteed! > It is rather heavy though: you make two pthreads > and read one fd in each, then send the > results down a single Event channel: the user code > can then read the parsed objects in sequence, > blocking until the first is available, then blocking > until the second is available. > > The point is that although this is heavy, it is guaranteed > to work, so using Event module with pthreads is actually > easier to reason about. I understand this perfectly, but I don't think it obviates the need for select on channels. The programmer should be free to choose the approach that suits him best, not have it forced upon him by limitations in the standard library. > If you would like to do this without the cost of spawning > pthreads .. then you need to use Felix, not Ocaml :) Unfortunately that's not an option for me, but maybe in the future... Cheers, -n8 -- >>>-- Nathaniel Gray -- Caltech Computer Science ------> >>>-- Mojave Project -- http://mojave.cs.caltech.edu -->