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.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 90FE9BC37 for ; Fri, 7 Aug 2009 09:54:49 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQBAP95e0pRZ90vkWdsb2JhbACaQAEBAQEJCwoHEwO0YYQWBQ X-IronPort-AV: E=Sophos;i="4.43,340,1246831200"; d="scan'208";a="30884496" Received: from mtaout01-winn.ispmail.ntl.com ([81.103.221.47]) by mail2-smtp-roc.national.inria.fr with ESMTP; 07 Aug 2009 09:54:49 +0200 Received: from aamtaout04-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090807075448.KFY6742.mtaout01-winn.ispmail.ntl.com@aamtaout04-winn.ispmail.ntl.com>; Fri, 7 Aug 2009 08:54:48 +0100 Received: from romulus.metastack.com ([81.102.132.77]) by aamtaout04-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090807075448.NSHH22934.aamtaout04-winn.ispmail.ntl.com@romulus.metastack.com>; Fri, 7 Aug 2009 08:54:48 +0100 Received: from Tenor ([172.16.0.17]) (authenticated bits=0) by romulus.metastack.com (8.14.2/8.14.2) with ESMTP id n777seL7001351 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 7 Aug 2009 08:54:42 +0100 From: "David Allsopp" To: "'Christoph Bauer'" , References: In-Reply-To: Subject: RE: [Caml-list] windows, threads and sockets Date: Fri, 7 Aug 2009 08:54:38 +0100 Message-ID: <001701ca1734$5158e900$f40abb00$@metastack.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcoXMsZ1uIEkHuNHQB6lMvIyG9T6ygAARRPA Content-Language: en-gb Organization: MetaStack Solutions Ltd. X-Scanned-By: MIMEDefang 2.65 on 81.102.132.77 X-Cloudmark-Analysis: v=1.0 c=1 a=Fm1F6rdJwNsA:10 a=1hrdfmW9cNPN-w8LQD8A:9 a=LvCXS6IM0DU8Phy7Gw9qQzGyt2cA:4 X-Spam: no; 0.00; sockets:01 sockets:01 ocaml:01 otherlibs:01 semantics:01 bug:01 threads:01 wrote:01 unix:01 unix:01 caml-list:01 explicitly:02 snip:02 rewritten:02 seems:03 Christoph Bauer wrote: > I'm not quite sure what is going on, but my best bet is this: the main > loop waits for the sockets with > > Unix.select listOfSockets [] [] timeout > > One socket is the listener socket on which new connections > are made. Unix.select returns a list of sockets. Initially > it must be the listener socket. This is checked with a compare > > socket = listenSocket > > and this seems to be suddenly wrong (just in the thread case). > > Any ideas? I can't tell you explicitly why it has failed, but Unix.select was completely rewritten for OCaml 3.11.0 based on a big contribution from Sylvain Le Gall (see otherlibs/win32unix/select.c). The principal aim was to make the semantics of Unix.select the same between *NIX and Windows so if it works on Linux then it sounds like you've hit a bug... David