[spambayes-dev] Re: [Spambayes] fatal error?

Barry Warsaw barry at python.org
Tue Aug 26 15:18:13 EDT 2003


On Tue, 2003-08-26 at 09:52, Mark Hammond wrote:

> The addin is "mainly" single-threaded - Outlook always calls us from the
> same thread.  The only time a second thread is used is by the "training" or
> "filtering" dialogs.  If "training" is running, then this thread will be
> updating the database - however, in that case, the dialog is up, which is
> modal, so there is no way the other thread could be doing a training
> operation.
> 
> The passage you quoted doesn't rule out the possibility that this error
> could occur even if only one thread is writing, but another is reading.  If
> that is a problem, then yes, we would hit it :)

Note that for the Berkeley-based storages, I had to implement
application level locking for all reads and writes, but in that
"application" there are definitely multiple threads doing both. 
Berkeley itself has a lock subsystem, but I couldn't trust that because
it is statically allocated and there are situations during some
transactions where an unbounded number of pages could get touched,
exhausting the lock table.  So I ditched Berkeley's locks and used an
application level (threading) lock.

FWIW,
-Barry

p.s. at one point there was talk of a Usenet group for BerkeleyDB
programmers.  I sure wish that existed.





More information about the spambayes-dev mailing list