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
[OT?] spamoracle concurrency
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-04-13 (06:56)
From: Gabriel Kerneis <gabriel.kerneis@e...>
Subject: Re: [Caml-list] [OT?] spamoracle concurrency
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Le Fri, 13 Apr 2007 08:39:10 +0200, Alain Frisch
<Alain.Frisch@inria.fr> a =E9crit :
> Looking at the code very: spamoracle write its database to a fresh=20
> temporary file and then rename it. With a local file system (not NFS)=20
> under Unix, this is atomic. It is thus safe to "mark" and "add" in=20
> parallel, but if you do several "add" in parallel, you'll not get the=20
> expected behavior (but the database will not be corrupted).

(I'm not an Unix guru so this might be a silly question)

What about the following scenario :
1) "spamoracle add" reads the database, updates it and writes it to a
fresh file
2) "spamoracle read" begins to read the database from file
3) "spamoracle add" renames the file
4) "spamoracle read" finishes to read the database from file and closes
the file (which no longer exists ?)

Is it safe ? I guess it's only changing the i-nodes but does it
influence "spamoracle read" in any way ?

Gabriel Kerneis

Content-Type: application/pgp-signature; name=signature.asc
Content-Disposition: attachment; filename=signature.asc

Version: GnuPG v1.4.6 (GNU/Linux)