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.4 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id F00D6BC6C for ; Fri, 8 Feb 2008 14:27:06 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah4FAPrmq0dDWxLC/2dsb2JhbACBWapL X-IronPort-AV: E=Sophos;i="4.25,321,1199660400"; d="scan'208";a="8959799" Received: from ip67-91-18-194.z18-91-67.customer.algx.net (HELO server1.bertec.net) ([67.91.18.194]) by mail3-smtp-sop.national.inria.fr with ESMTP; 08 Feb 2008 14:27:06 +0100 Received: from kuba.bertec.net (kuba.bertec.net [192.168.2.16]) by server1.bertec.net (Postfix) with ESMTP id 4C213105746 for ; Fri, 8 Feb 2008 08:27:04 -0500 (EST) From: Kuba Ober To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Ocaml debugger under Windows Date: Fri, 8 Feb 2008 08:27:03 -0500 User-Agent: KMail/1.9.6 (enterprise 0.20071204.744707) References: <90823c940802050146u7cac0aape4e72b4fc6a3089@mail.gmail.com> <47A83251.7010306@frisch.fr> <90823c940802050923h77a95192gdabcd9c0807dccd6@mail.gmail.com> In-Reply-To: <90823c940802050923h77a95192gdabcd9c0807dccd6@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200802080827.03382.ober.14@osu.edu> X-Spam: no; 0.00; ocaml:01 debugger:01 frisch:01 frisch:01 ocaml:01 mingw:01 mingw:01 debugger:01 iter:01 funct:01 funct:01 eintr:01 async:01 cheers:01 wrote:01 On Tuesday 05 February 2008, Dmitry Bely wrote: > On Feb 5, 2008 12:54 PM, Alain Frisch wrote: > > Dmitry Bely wrote: > > > The topic has a long history [1], but since then nothing has actually > > > changed. It's easy to understand: INRIA people are busy and there are > > > probably quite few Ocaml users in the Windows land to worry about. So I > > > decided to do something myself :) (as it was with mingw port several > > > years ago). > > > > > >... > > > > > > If it's interesting for anyone I can publish a patch against Ocaml > > > 3.10.1 > > > > Yes, that's definitely interesting for us! > > > > Is there any hope to build the server with the mingw or msvc port? > > As soon as the following function is rewritten: > > debugger/input_handling.ml > > (* Handle active files until `continue_main_loop' is false. *) > let main_loop () = > let old_state = !continue_main_loop in > try > continue_main_loop := true; > while !continue_main_loop do > try > let (input, _, _) = > select (List.map fst !active_files) [] [] (-1.) > in > List.iter > (function fd -> > let (funct, iochan) = (List.assoc fd !active_files) in > funct iochan) > input > with > Unix_error (EINTR, _, _) -> () > done; > continue_main_loop := old_state > with > x -> > continue_main_loop := old_state; > raise x > > here Unix.select() waits for both network and user input events. There's a windows API function for that. As long as the newtork access can be wrapped in the usual aysnchronous I/O primitives, there's a wait function that will wait on an async conditition *or* a message. Cheers, Kuba