From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id F04217EE4B for ; Thu, 10 Oct 2013 16:59:29 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of louis.gesbert@ocamlpro.com) identity=pra; client-ip=212.227.126.186; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="louis.gesbert@ocamlpro.com"; x-sender="louis.gesbert@ocamlpro.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of louis.gesbert@ocamlpro.com) identity=mailfrom; client-ip=212.227.126.186; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="louis.gesbert@ocamlpro.com"; x-sender="louis.gesbert@ocamlpro.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of postmaster@moutng.kundenserver.de designates 212.227.126.186 as permitted sender) identity=helo; client-ip=212.227.126.186; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="louis.gesbert@ocamlpro.com"; x-sender="postmaster@moutng.kundenserver.de"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AosJAEfAVlLU4366nGdsb2JhbAA/GoM/himob5IXS4EiFg4BAQEBAQYNCQkUKIIlAQEFOjQLEAsYCQQRCQcPATUBAwENBgESEodiAw8ECDavJwOJdYktg0aCVAeEIwOZNJN5 X-IPAS-Result: AosJAEfAVlLU4366nGdsb2JhbAA/GoM/himob5IXS4EiFg4BAQEBAQYNCQkUKIIlAQEFOjQLEAsYCQQRCQcPATUBAwENBgESEodiAw8ECDavJwOJdYktg0aCVAeEIwOZNJN5 X-IronPort-AV: E=Sophos;i="4.90,1072,1371074400"; d="scan'208";a="29838615" Received: from moutng.kundenserver.de ([212.227.126.186]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 10 Oct 2013 16:59:29 +0200 Received: from ocp-dell.localnet (perens.inria.fr [128.93.60.79]) by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis) id 0M7A1q-1VfeOa3M6Y-00x4DA; Thu, 10 Oct 2013 16:59:22 +0200 From: Louis Gesbert To: caml-list@inria.fr, Romain Bardou Cc: Arnaud Spiwack Date: Thu, 10 Oct 2013 16:59:21 +0200 Message-ID: <17063385.vVJpguqPzc@ocp-dell> Organization: OCamlPro User-Agent: KMail/4.10.5 (Linux/3.10-2-amd64; KDE/4.10.5; x86_64; ; ) In-Reply-To: <52569C69.1050408@inria.fr> References: <52551D48.2030204@inria.fr> <52569C69.1050408@inria.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V02:K0:j+BD43mO80lB5c3VMnFxmlHjY/MnSLGn+d0lRb10txq M0BEVRS8SetbAj8XuEkJ5rBUVMm+c7OeRlCuPxbNTzkXmqVOcP Le60WvxH/9b5xnZwtewupF+jNeY0dvGst7PRv8OdrRQdBLhKuG 4iz6UrsxdTspL7i/j8esyQIKS+rx1dPuJ8CeEBLjN6w1GhhLIN MIh3v/PA+NhgO03Lj4CfLb0swz7Wz6+4xyB4GA2koE7uEjnkJa NnXmXut+yppypUFX/8q8b5aGPMi5qN4lhaUaoi7HShez2k9VQt NPPcg5wYE92Kk4mQsAeXJ4meyN6ufa1w5EEvf7BfKTn7uSfuRq J+LA/fpk/eeKsSnJjaTI= X-Validation-by: louis.gesbert@ocamlpro.com Subject: Re: [Caml-list] [ANN] Procord 0.1.0: Delegate tasks to other processes You may find the bindings for Terminate_process in ocaml-top useful [1]. I also had to handle sending a SIGINT to the ocaml toplevel, which wasn't very fun, [1] https://github.com/OCamlPro/ocaml-top/blob/master/src/sigint_win.c Louis Gesbert -- OCamlPro On Thursday 10 October 2013 14:24:09 Romain Bardou wrote: > Indeed. In fact I made a feature request about this: > > http://caml.inria.fr/mantis/view.php?id=6146 > > So, just waiting for OCaml 4.02 will solve the issue. > > If waiting is not an option I can of course add this in Procord. I > should at least provide a way to get the PID / Process Handle so that > one can call TerminateProcess using his own binding. > > While we are discussing the differences between Windows and Linux, there > is actually another one: the Windows server does not fork and, thus, > only accepts one task at a time. This could be solved by having the > server execute himself to run the tasks. But before actually > implementing this I prefer to wait and see whether there is a real need > (Windows servers are less common). > > Cheers, > > > I see you are using Unix.kill to kill processes. But I was under the > > impression that it didn't work properly on Windows. Am I mistaken? > > > > > > On 9 October 2013 11:09, Romain Bardou > > wrote: > > > > I am happy to announce the first release of Procord, a portable library > > to delegate tasks to other processes. > > > > Obtain it with opam: > > > > opam install procord > > > > Or, download the tarball: > > > > https://github.com/cryptosense/procord/archive/v0.1.0.tar.gz > > > > View a minimal, commented example: > > > > https://github.com/cryptosense/procord/blob/master/examples/minimal.ml > > > > You can browse the API at: > > > > http://cryptosense.github.io/procord/api/index.html > > > > Procord can spawn local worker processes or communicate using sockets to > > a remote worker server. Workers will receive an input, execute a > > function on this input, and send back the result. Meanwhile, the main > > program can continue to run while waiting for the results. > > > > Not relying on threads, Procord is robust - a segmentation fault in the > > worker will not kill the main program. Not relying on fork, Procord is > > portable - it has been tested on Linux and Windows. > > > > Procord provides an easy way to have the same executable act as a worker > > - local or remote - or as the main program. The actual behavior can be > > specified on the command-line. The default is to run as the main > > program, which delegates tasks by running itself. > > > > I will present Procord at the OUPS meeting of this evening. > > > > -- > > Romain Bardou > > > > -- > > Caml-list mailing list. Subscription management and archives: > > https://sympa.inria.fr/sympa/arc/caml-list > > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > > Bug reports: http://caml.inria.fr/bin/caml-bugs > > > > > > >