Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Gabriel Kerneis <gabriel.kerneis@e...>
Subject: Re: [Caml-list] [OT?] spamoracle concurrency
--Sig_qrqJVfB2GPzPqsDLzo_JvmV
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 ?

Regards,
--=20
Gabriel Kerneis


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGHymV6a2JmXQu5bYRAhG/AJ4xSyBAS5qMBk9eK7dRBXHKBpga8QCeInfP
1MgeYgLsWqR3ynufRTFgYg0=
=Byto
-----END PGP SIGNATURE-----

--Sig_qrqJVfB2GPzPqsDLzo_JvmV--