English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Will Ocaml use a 4-way SMP box without splitting the program into separate processes?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-07-15 (11:32)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: [Caml-list] Will Ocaml use a 4-way SMP box without splitting the program into separate processes?
> As I understand it, Ocaml has one master lock for handling threading.


> Doesn't this mean that a process can never use more than one processor?

Yes, if the process is entirely composed of Caml code.  Long-running C
primitives release the lock, meaning that your 4-processor machine can
have 1 processor running Caml code and 3 executing C primitives,
e.g. database queries.

> And if that is true, following Xavier Leroy idea "Using
> separate processes for the HTTP server/servlet container and for the
> servlets (but not starting a new servlet process on each request like
> CGI does)" is the only scalable way to go.

You're correct that a solution based on multiple processes
communicating over byte streams (pipes, sockets, etc) is highly
scalable, not only to SMP systems but also to clusters.  Such an
architecture can be made reasonably efficient even on a single
machine, see X Windows for evidence.

> Because, I don't think a solution that doesn't use a SMP-machine effectively
> is a good solution.

Perhaps.  I don't know how important shared-memory multiprocessing is
important for large Web applications.  Centralized databases can
certainly benefit from large SMP machines, but it was my impression
that everything else is equally well done on multiple, inexpensive
single-processor PCs.  (Cf. Google vs. Altavista.)

At any rate, I believe a single-processor PC can handle a fairly high
Web traffic, if well programmed.  Of course, if you're amazon.com or
google.com that will not suffice, but it should be enough for
joesbusiness.com :-)

- Xavier Leroy
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr