From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p82Ew94j030925 for ; Fri, 2 Sep 2011 16:58:12 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAM3uYE5QRFuw/2dsb2JhbABCqGV4gUYBAQUnCwFGEAsOChwSFCghiAe4KYYFYASkOg X-IronPort-AV: E=Sophos;i="4.68,319,1312149600"; d="scan'208";a="107517454" Received: from furbychan.cocan.org ([80.68.91.176]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 02 Sep 2011 16:58:04 +0200 Received: from rich by furbychan.cocan.org with local (Exim 4.72) (envelope-from ) id 1QzVBy-0004Mw-VR; Fri, 02 Sep 2011 15:58:02 +0100 Date: Fri, 2 Sep 2011 15:58:02 +0100 From: "Richard W.M. Jones" To: David Allsopp Cc: "caml-list@inria.fr" Message-ID: <20110902145802.GA16767@annexia.org> References: <20110902075100.GA4949@annexia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: [Caml-list] Cross-platform cpu count On Fri, Sep 02, 2011 at 08:19:00AM +0000, David Allsopp wrote: > Richard W.M. Jones wrote: > > On Fri, Sep 02, 2011 at 02:04:51AM +0200, Daniel Bünzli wrote: > > > Hello, > > > > > > Can anybody confirm me that the following code works on cygwin : > > > > > > let cpu_count () = > > > try match Sys.os_type with > > > | "Win32" -> int_of_string (Sys.getenv "NUMBER_OF_PROCESSORS") > > > | _ -> > > > let i = Unix.open_process_in "getconf _NPROCESSORS_ONLN" in > > > > Don't know about Cygwin, but it won't work on MinGW. > > What's your reason? (given that it does work) Yes, indeed it does. The lesson is I should try it before pontificating! Rich. -- Richard Jones Red Hat