Version française
Home     About     Download     Resources     Contact us    
Browse thread
scalable web apps
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jérémie Dimino <jeremie@d...>
Subject: Re: [Caml-list] scalable web apps
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