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
Ian Zimmerman wrote:
> The question is: does spamoracle do any kind of locking on the database?
> And what kind?  Clearly, if I pipe my mails through "spamoracle mark" in
> my procmail (or maildrop, etc.) configuration, spamoracle may run and
> access the database at completely unpredictable times.  Is it safe to
> do "spamoracle add" while this is enabled?  Or do I have to slap a
> locking scheme on top myself?
> 
> Bonus question, if locking is in fact done, does it let multiple
> "spamoracle mark" processes through at the same time (which should be safe)?

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).

-- Alain