From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 521B3BC69 for ; Fri, 13 Apr 2007 08:56:25 +0200 (CEST) Received: from smtp4-g19.free.fr (smtp4-g19.free.fr [212.27.42.30]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l3D6uO4W031897 for ; Fri, 13 Apr 2007 08:56:25 +0200 Received: from kerneis.info (kerneis.info [82.224.215.18]) by smtp4-g19.free.fr (Postfix) with ESMTP id DB1236B9C5 for ; Fri, 13 Apr 2007 08:56:24 +0200 (CEST) Received: from localhost ([127.0.0.1] helo=kerneis.info ident=gabriel) by kerneis.info with esmtp (Exim 4.63) (envelope-from ) id 1HcFhm-0000sJ-EI for caml-list@yquem.inria.fr; Fri, 13 Apr 2007 08:56:22 +0200 Date: Fri, 13 Apr 2007 08:56:21 +0200 From: Gabriel Kerneis To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] [OT?] spamoracle concurrency Message-ID: <20070413085621.7fbb74b3@kerneis.info> In-Reply-To: <461F258E.5030905@inria.fr> References: <87ps68u7ub.fsf@unicorn.ahiker.homeip.net> <461F258E.5030905@inria.fr> X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; boundary=Sig_qrqJVfB2GPzPqsDLzo_JvmV; protocol="application/pgp-signature"; micalg=PGP-SHA1 X-Miltered: at discorde with ID 461F2999.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; 0200,:01 frisch:01 frisch:01 renames:01 unix:01 unix:01 caml-list:01 writes:01 alain:01 alain:01 concurrency:02 exists:03 gnu:03 rename:04 guess:04 --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 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--