[Spambayes] locking pickle/dbm against concurrent access?

Skip Montanaro skip at pobox.com
Mon Jan 20 09:00:41 EST 2003

Depending on how training and classifying are accomplished, it's quite
possible that the two activities will be done in different processes.  For
example, I am currently experimenting with training using pop3proxy (well,
still my offshoot proxytrainer at the moment) while classification is being
done by hammiefilter run from procmail.  This implies a need to lock the
shelve/pickle file used to store the training info.  Seems to me we need to
(be able to) lock the shelve/pickle file.  The only lock facility which
seems cross-platform enough for this application is the set of flags used by
os.open().  To lock the database you'd have to check/create a lock file
related (namewise) to the actual database file.  Has anyone given this any


More information about the Spambayes mailing list