From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 8F67EBC48 for ; Tue, 5 Apr 2005 15:34:47 +0200 (CEST) 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 j35DYlKi006929 for ; Tue, 5 Apr 2005 15:34:47 +0200 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 PAA30775 for ; Tue, 5 Apr 2005 15:34:46 +0200 (MET DST) Received: from saul.cis.upenn.edu (SAUL.CIS.upenn.edu [158.130.12.4]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j35DYi3P032439 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 5 Apr 2005 15:34:46 +0200 Received: from localhost (localhost [127.0.0.1]) by saul.cis.upenn.edu (8.12.10/8.12.9) with ESMTP id j35DYgCP015620; Tue, 5 Apr 2005 09:34:43 -0400 (EDT) Date: Tue, 05 Apr 2005 09:34:39 -0400 (EDT) Message-Id: <20050405.093439.68549116.eijiro_sumii@anet.ne.jp> To: caml-list@inria.fr Cc: sumii@saul.cis.upenn.edu Subject: Re: [Caml-list] select (or polling) on in_channel? From: Eijiro Sumii In-Reply-To: <425226CF.80708@barettadeit.com> References: <20050404.162414.18571932.eijiro_sumii@anet.ne.jp> <425226CF.80708@barettadeit.com> X-Mailer: Mew version 3.2 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 425293F7.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 425293F4.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 eijiro:01 sumii:01 eijiro:01 sumii:01 baretta:01 buffered:01 buffering:01 buffer:01 buffering:01 kernels:01 model:01 unix:01 checking:01 thread:02 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: From: "Alex Baretta" > My impression is that select and buffered IO are concepts that do > not live well together. Actually, I don't quite think so - buffering can often be regarded an optimization and select could be implemented just by checking the buffer in advance (as others have suggested). I also suppose there is at least some kind of buffering even inside UNIX OS kernels with a "select" (or "poll" in Solaris) system call. > I would attempt to model the problem in a multithreaded paradigm, where > the the "selecting" is implicit in the thread scheduling mechanism. I rather want to avoid multi-threading if select could be easy enough, because the former is often too tricky due to the possibility of deadlocks and races. Eijiro