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.4 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 F4045BC6F for ; Tue, 22 Aug 2006 08:41:18 +0200 (CEST) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k7M6fIRm018978 for ; Tue, 22 Aug 2006 08:41:18 +0200 Received: by nf-out-0910.google.com with SMTP id g2so2446048nfe for ; Mon, 21 Aug 2006 23:41:18 -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=POemP2MXVXzq4wPkmcnwYwXcwf24WNl79X8UMAjonMAqbkWkwPtu4Fkw3G7DsZ07Upt+AGFEO11+aQeD4zNRdpZixdKBhc2wsfM0eJubDti6xZ1J5Delmwe0V5H1xxPclFrTZCnR58HGc1gjEsbfiDvGbaekZkH1tzIqnIHsVmw= Received: by 10.49.29.3 with SMTP id g3mr567083nfj; Mon, 21 Aug 2006 23:41:17 -0700 (PDT) Received: by 10.78.194.3 with HTTP; Mon, 21 Aug 2006 23:41:17 -0700 (PDT) Message-ID: Date: Tue, 22 Aug 2006 18:41:17 +1200 From: "Jonathan Roewen" To: "Nathaniel Gray" 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 : 44EAA70E.000 on nez-perce : j-chkmail score : X : 0/20 1 X-Miltered: at nez-perce with ID 44EAA70E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; buffer:01 pervasives:01 unix:01 unix:01 ocaml:01 ocaml:01 marshal:01 caml-list:01 referenced:01 data:02 data:02 descriptor:02 descr:02 descr:02 blocking:04 > 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. Either one of us is misunderstanding the other.... Instead of using Pervasives.open_xxx, use Unix.openfile which returns Unix.file_descr, and also doesn't use internal ocaml buffering. Then, presumably, Unix.select would do what you expect, and then you can use Unix.in_channel_of_descr to get an ocaml in_channel to read from. And if I'm misunderstanding you, then perhaps the problem isn't really Unix.select... Jonathan