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.8 required=5.0 tests=AWL,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 B2E2EBC99 for ; Tue, 22 Aug 2006 08:27:42 +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 k7M6Rfeh015183 for ; Tue, 22 Aug 2006 08:27:42 +0200 Received: by wx-out-0506.google.com with SMTP id s6so1983035wxc for ; Mon, 21 Aug 2006 23:27:39 -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=QHRZ2rqTRGi54HnqXssVI58HKShM5pvKj2iu1tFDDZMN+aYaelfJTk1Kp34m6eJAXRLsHXWfpX2b+IHYxvP2UhJgP+GEqPi5Y9Pa3IBhjB2AIpa32T0JMcWevgmyE9FqMUkNmkt6lCTmFCN5eKAY8ueHfhotHIQ3YT6xZY5Hkxs= Received: by 10.90.65.11 with SMTP id n11mr375344aga; Mon, 21 Aug 2006 23:27:39 -0700 (PDT) Received: by 10.90.106.19 with HTTP; Mon, 21 Aug 2006 23:27:39 -0700 (PDT) Message-ID: Date: Mon, 21 Aug 2006 23:27:39 -0700 From: "Nathaniel Gray" To: "Jonathan Roewen" Subject: Re: [Caml-list] Re: Select on channels (again) Cc: "Caml Mailing List" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-j-chkmail-Score: MSGID : 44EAA3DD.000 on nez-perce : j-chkmail score : X : 0/20 1 X-Miltered: at nez-perce with ID 44EAA3DD.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; unix:01 unix:01 ocaml:01 descriptors:01 ocaml:01 buffer:01 cheers:01 wrote:01 marshal:01 caml-list:01 functions:01 referenced:01 data:02 data:02 descriptor:02 On 8/21/06, Jonathan Roewen wrote: > Why can't you just use the unix file opening functions since you're > using unix select? And if you need the ocaml in/out channels, convert > the unix file descriptors to ocaml ones instead of the other way > around. Seems simple enough to me. It sounds simple but doesn't work. If select tells you a file descriptor doesn't have data waiting you can't be sure there isn't still data in the corresponding channel's buffer. See the thread that I referenced for a good discussion of why this is annoying. For one thing, it makes it impossible to use Marshal.from_channel without potentially blocking. Cheers, -n8 -- >>>-- Nathaniel Gray -- Caltech Computer Science ------> >>>-- Mojave Project -- http://mojave.cs.caltech.edu -->