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: Alain Frisch <alain.frisch@i...>
Subject: Re: [Caml-list] [OT?] spamoracle concurrency
Gabriel Kerneis wrote:
> 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 ? 

Yes, it is. In step 4, "spamoracle read" sees the old version of the
file through the already opened file descriptor.

-- Alain