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=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr 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 5BD44BC86 for ; Wed, 23 Aug 2006 10:29:17 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k7N8TGfO004100 for ; Wed, 23 Aug 2006 10:29:16 +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 KAA23943 for ; Wed, 23 Aug 2006 10:29:16 +0200 (MET DST) Received: from mail-outfwd.lms.be (Kaiserslautern1.lms-gmbh.de [213.68.136.230]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k7N8TFKS003611 for ; Wed, 23 Aug 2006 10:29:15 +0200 Received: from localhost (unknown [127.0.0.1]) by mail-outfwd.lms.be (Postfix) with ESMTP id 5A1027F4AB; Wed, 23 Aug 2006 10:57:40 +0200 (CEST) Received: from mail-kl.lmsintl.com ([127.0.0.1]) by localhost (kl-ftp [127.0.0.1]) (amavisd-new, port 20024) with ESMTP id 09689-09; Wed, 23 Aug 2006 10:57:40 +0200 (CEST) Received: from kaiserslautern1.lmsintl.com (unknown [10.2.0.100]) by mail-kl.lmsintl.com (Postfix) with ESMTP id 4559FB6ED1; Wed, 23 Aug 2006 10:57:40 +0200 (CEST) Received: by kaiserslautern1.lmsintl.com with Internet Mail Service (5.5.2653.19) id ; Wed, 23 Aug 2006 10:29:14 +0200 Message-ID: <26EB47FDD566A7469FC862DAF373792F018CF5F4@kaiserslautern1.lmsintl.com> From: Christoph Bauer To: Robert Roessler , Caml-list Subject: Re: [Caml-list] Re: Select on channels (again) Date: Wed, 23 Aug 2006 10:29:13 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain X-Virus-Scanned: by IT Services X-Miltered: at concorde with ID 44EC11DC.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 44EC11DB.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; stub:01 buffer:01 otherlibs:01 unix:01 buffer:01 unix:01 ocaml:01 msdn:01 wrote:01 caml-list:01 pair:01 pipes:02 pipes:02 bytes:03 module:03 > > ... > > I did this, but on windows with two programs communicating > over a pipe > > this isn't enough. select on windows and on a pipe doesn't work. > > Therefore I wrote a stub for PeekNamedPipe(): > > "Select on windows" certainly does work... and why not use a > socket pair, just as one might on a *nix system? That way, > it will work on both. Select doesn't work on window pipes. In retrospect sockects would be the better choice. I stumbled in a strange dead lock with theses pipes, because under windows the pipe buffer is set to 1024 bytes (otherlibs/win32unix/pipe.c) and will then block til the reader reads the contents. IMO this value (SIZEBUF) should be zero to let the system choose the best buffer size. [1] > And the fact that socketpair has been left out of the Windows > version of the Unix module is not an impediment - it is easy > to write a useful implementation in OCaml (I can supply one > if needed). Please supply one. Christoph Bauer [1] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipc/base/cr eatepipe.asp