[Spambayes] locking pickle/dbm against concurrent access?

Anthony Baxter anthony at interlink.com.au
Tue Jan 21 11:52:05 EST 2003


>>> Skip Montanaro wrote
> How do you get the temp file from the real file without copying it?  If I
> understand the way things work, you'd do something like
> 
>     * copy real to temp
>     * train on new messages
>     * update temp
>     * move temp back to real (the atomic part we all want)

I thought it'd be more like:

      * open real in read-only mode, load into memory
      * train on new messages
      * write new data out to temp
      * rename temp to real (atomically)


-- 
Anthony Baxter     <anthony at interlink.com.au>   
It's never too late to have a happy childhood.




More information about the Spambayes mailing list