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.9 required=5.0 tests=AWL,SPF_SOFTFAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id AD31ABC37 for ; Fri, 7 Aug 2009 09:43:42 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhEBAB54e0pVnosjkWdsb2JhbACBUphuAQEBAQkLCgcTBbRVhBYF X-IronPort-AV: E=Sophos;i="4.43,340,1246831200"; d="scan'208";a="44428393" Received: from mail179.messagelabs.com ([85.158.139.35]) by mail4-smtp-sop.national.inria.fr with SMTP; 07 Aug 2009 09:43:42 +0200 X-VirusChecked: Checked X-Env-Sender: christoph.bauer@lmsintl.com X-Msg-Ref: server-14.tower-179.messagelabs.com!1249631021!41578183!1 X-StarScan-Version: 6.1.3; banners=-,-,- X-Originating-IP: [213.68.136.230] Received: (qmail 11736 invoked from network); 7 Aug 2009 07:43:41 -0000 Received: from kaiserslautern1.lms-gmbh.de (HELO mail-in.lmsintl.com) (213.68.136.230) by server-14.tower-179.messagelabs.com with SMTP; 7 Aug 2009 07:43:41 -0000 Received: from KL-SRV57.lmsintl.com (unknown [10.2.100.57]) by mail-in.lmsintl.com (Postfix) with ESMTP id 6F12043C005 for ; Fri, 7 Aug 2009 12:09:45 +0200 (CEST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: windows, threads and sockets Date: Fri, 7 Aug 2009 09:43:37 +0200 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: windows, threads and sockets Thread-Index: AcoXMsZ1uIEkHuNHQB6lMvIyG9T6yg== From: "Christoph Bauer" To: X-Spam: no; 0.00; sockets:01 ocaml:01 -thread:01 sockets:01 threads:01 threads:01 unix:01 unix:01 compile:01 behaviour:01 seems:03 christoph:04 christoph:04 listener:04 listener:04 Hi, I'm using OCaml 3.11.0. My question is about my program, which used to work fine under windows and linux. The program is a daemon, which waits for socket connections and respondse to queries. Now I added an extension with uses threads. Everything is find on linux, but I have a very strange behaviour on windows. For the troubles it is sufficient to link agains threads and compile the main program with -thread. Without it everything is fine again. 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=20 are made. Unix.select returns a list of sockets. Initially it must be the listener socket. This is checked with a compare socket =3D listenSocket=20 and this seems to be suddenly wrong (just in the thread case). Any ideas? Thanks, Christoph Bauer