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.0 required=5.0 tests=AWL,SPF_FAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 7B2F0BC37 for ; Fri, 7 Aug 2009 10:34:47 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsCAE+Ee0pQW+UCe2dsb2JhbACaQQEBFiQEtHKEFgU X-IronPort-AV: E=Sophos;i="4.43,340,1246831200"; d="scan'208";a="34133053" Received: from main.gmane.org (HELO ciao.gmane.org) ([80.91.229.2]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/AES256-SHA; 07 Aug 2009 10:34:47 +0200 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MZKuT-0000JZ-OD for caml-list@inria.fr; Fri, 07 Aug 2009 08:34:45 +0000 Received: from ks300734.kimsufi.com ([91.121.65.225]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 Aug 2009 08:34:45 +0000 Received: from sylvain by ks300734.kimsufi.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 Aug 2009 08:34:45 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Sylvain Le Gall Subject: Re: windows, threads and sockets Date: Fri, 7 Aug 2009 08:34:36 +0000 (UTC) Message-ID: References: <001701ca1734$5158e900$f40abb00$@metastack.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ks300734.kimsufi.com User-Agent: slrn/pre1.0.0-2 (Linux) Sender: news X-Spam: no; 0.00; le-gall:01 sockets:01 ocaml:01 otherlibs:01 semantics:01 bug:01 workarounds:01 otherlibs:01 overwrite:01 scheduler:01 ocaml:01 bug:01 threads:01 threads:01 wrote:01 Hello, On 07-08-2009, Christoph Bauer wrote: >> > 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... >> > Good to know, I missed that change. So the new Unix.select should > now work also on pipes? I guess it from the function named > read_pipe_poll() > in select.c. This is good news, because I can throw away some > workarounds. In no-thread context, it works great... (with pipe and console et al) > > But maybe the problem with thread is, that not > otherlibs/win32unix/select.c > is used. There is also otherlibs/threads/unix.ml with seems to overwrite > Unix.select > and there are select() calls in otherlibs/threads/scheduler.c. I'm just > guessing > here. Indeed, I miss this case because I don't use thread in ocaml code. However I don't see interaction between otherlibs/win32unix/select.c and otherlibs/threads/unix.ml, so I am not sure where the bug comes from. It also show that pipe/console is not available when you use select with thread :( Something that can change is that we now use WinSock 2.0... > > So maybe the simples solution for me (I have to stick to 3.11.0) > would be to create my thread in plain C, link against is and omit the > dreaded threads library ;-) The task of my thread is very simple... > Regards, Sylvain Le Gall