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

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to