Version franaise
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: Török Edwin <edwintorok@g...>
Subject: Re: [Caml-list] scalable web apps
On Sun, 25 Jul 2010 06:52:46 -0700 (PDT)
Dario Teixeira <darioteixeira@yahoo.com> wrote:

> The only circumstance where I would be cautious on relying solely on a
> naked Ocsigen is if you are also required to serve plenty of static
> content (images, etc).  Even though Ocsigen includes an extension for
> serving static pages, for hysterical reasons no Unix supports
> non-blocking mode for regular files, which of course causes problems
> for Lwt-apps (see the Lwt manual for more information on this).

I thought ocaml's "threads" are meant to solve the I/O problem.
Doesn't it use native pthreads for each OCaml thread, and prior to
performing I/O it releases the mutex allowing other threads to run?
Of course you'd still have to wait for the I/O to complete to serve the
file to one particular user, but in the meantime you could serve some
other (already cached) file to another user, generate some dynamic
content, etc.

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? Has anyone tried to measure the performance of doing that?

Best regards,
--Edwin