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.8 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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id DA035BBAF for ; Tue, 10 Mar 2009 18:19:17 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApYFAFs+tklQRFuwX2dsb2JhbACVJBcLCgQUvXaEDAY X-IronPort-AV: E=Sophos;i="4.38,336,1233529200"; d="scan'208";a="22339293" Received: from furbychan.cocan.org ([80.68.91.176]) by mail2-smtp-roc.national.inria.fr with ESMTP; 10 Mar 2009 18:19:17 +0100 Received: from rich by furbychan.cocan.org with local (Exim 4.63) (envelope-from ) id 1Lh5bm-0006re-Dp; Tue, 10 Mar 2009 17:19:14 +0000 Date: Tue, 10 Mar 2009 17:19:14 +0000 To: Alan Schmitt Cc: caml-list@inria.fr Subject: Re: [Caml-list] options to write a cross-platform interacting program in OCaml Message-ID: <20090310171914.GA25634@annexia.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) From: Richard Jones X-Spam: no; 0.00; ocaml:01 0100,:01 schmitt:01 modular:01 ctrl-c:01 model:01 mingw:01 10,:98 2009:98 threads:01 wrote:01 wrote:01 unix:01 rewrite:01 caml-list:01 On Tue, Mar 10, 2009 at 05:28:11PM +0100, Alan Schmitt wrote: > I am looking at what options there are to rewrite camlgrenouille, a > small client for www.grenouille.com that I wrote a while ago, to make > it more modular (to allow an external UI to the core program) and > cross-platform (Unix and Windows). > > In a nutshell, this program periodically runs some tests. Right now > its interaction with the outside is fairly limited: the only thing one > can do is ask it to quit (by doing a ctrl-c which is caught so as to > clean up before actually quitting). I would like to be able to send it > more complex commands, which would be driven by a UI separate from the > program. > > The simplest approach seems to be using a socket and a select call > (with a timeout corresponding to the delay until the next test), but I > was wondering if there were other options based on threads. For > instance, could I use lwt under Windows? For such a simple model I'm pretty certain that using select is going to be the easiest way. For the cross-platform bit, don't forget to take a look at the Fedora- MinGW project. Rich. -- Richard Jones Red Hat