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 yquem.inria.fr (Postfix) with ESMTP id 1740BBBAF for ; Mon, 26 Jul 2010 09:58:59 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAF7dTEzVuiYS/2dsb2JhbACfYHG+dw2FKQQ X-IronPort-AV: E=Sophos;i="4.55,260,1278280800"; d="scan'208";a="54735512" Received: from solaria.dimino.org ([213.186.38.18]) by mail3-smtp-sop.national.inria.fr with ESMTP; 26 Jul 2010 09:58:58 +0200 Received: from aurora (localhost.localdomain [127.0.0.1]) by solaria.dimino.org (Postfix) with ESMTP id 32C5F80048; Mon, 26 Jul 2010 09:58:58 +0200 (CEST) Received: by aurora (Postfix, from userid 1000) id EF14940A39; Mon, 26 Jul 2010 09:59:01 +0200 (CEST) Date: Mon, 26 Jul 2010 09:59:01 +0200 From: =?iso-8859-1?Q?J=E9r=E9mie?= Dimino To: =?iso-8859-1?B?VPZy9ms=?= Edwin Cc: Dario Teixeira , caml-list@yquem.inria.fr Subject: Re: [Caml-list] scalable web apps Message-ID: <20100726075901.GA5561@aurora> References: <914B9960-EBC8-439B-B7F8-A852859B522F@gmail.com> <407966.39005.qm@web111512.mail.gq1.yahoo.com> <20100726102904.10ed4768@deb0> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20100726102904.10ed4768@deb0> User-Agent: Mutt/1.5.20 (2009-06-14) X-Spam: no; 0.00; scalable:01 ocaml:01 26,:98 edwin:98 threads:01 threads:01 wrote:01 caml-list:01 slower:02 btw:03 seems:03 threaded:03 asynchronous:03 apps:04 jul:05 On Mon, Jul 26, 2010 at 10:29:04AM +0300, Török Edwin wrote: > Lwt's Lwt_preemptive seems to allow one to use 'preemptive > threads' (which I assume are just usual OCaml threads). > So would it be possible to put the file I/O on Lwt_preemptive.detach > threads? Yes. > Has anyone tried to measure the performance of doing that? Yes, i tried it some time ago with two small C programs which were just reading a file on the disk. One doing read operations in a simple loop, and one launching a thread for each read operation (or reusing the same thread). The threaded version was about 100 times slower than the non-threaded one. BTW it is planed to add some kind of asynchronous file I/O support in Lwt by using mmap and mincore. Best, -- Jérémie