Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Gabriel Kerneis <gabriel.kerneis@enst.fr>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] [OT?] spamoracle concurrency
Date: Fri, 13 Apr 2007 08:56:21 +0200	[thread overview]
Message-ID: <20070413085621.7fbb74b3@kerneis.info> (raw)
In-Reply-To: <461F258E.5030905@inria.fr>

[-- Attachment #1: Type: text/plain, Size: 973 bytes --]

Le Fri, 13 Apr 2007 08:39:10 +0200, Alain Frisch
<Alain.Frisch@inria.fr> a écrit :
> Looking at the code very: spamoracle write its database to a fresh 
> temporary file and then rename it. With a local file system (not NFS) 
> under Unix, this is atomic. It is thus safe to "mark" and "add" in 
> parallel, but if you do several "add" in parallel, you'll not get the 
> 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,
-- 
Gabriel Kerneis


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2007-04-13  6:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-13  6:06 Ian Zimmerman
2007-04-13  6:39 ` [Caml-list] " Alain Frisch
2007-04-13  6:56   ` Gabriel Kerneis [this message]
2007-04-13  7:57     ` Alain Frisch
2007-04-13  6:47 ` Gabriel Kerneis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070413085621.7fbb74b3@kerneis.info \
    --to=gabriel.kerneis@enst.fr \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox