un-threadsafe sqlite

David Relson relson at osagesoftware.com
Sun Apr 9 14:22:47 CEST 2006


On Fri,  7 Apr 2006 23:09:51 -0700
Nathaniel Irons wrote:

> I'd like to try bogofilter on a pair networks shared hosting account.
> They're using FreeBSD 4.8, and I'm having a hard time building sqlite with
> --enable-threadsafe -- make dies with a bunch of pthread errors.
> 
> Is bogofilter perchance safe to use with a sqlite back-end that isn't
> itself threadsafe? Because if bogofilter doesn't care, then I don't care,
> though I assume I get enough mail that there will be near-simultaneous
> invocations made on a regular basis.
> 
> Thanks,
> 
>   -nat

H'lo Nat,

Normally bogofilter opens the wordlist only for reading, which is
inherently safe from threading issues.

If you use the auto-update option, i.e. '-u', then there's a lot of
writing to the database.  If there's to be a cause of trouble, this is
it.

An alternate approach is to do all your wordlist updates "off-line" on
a copy of the wordlist and then deploy the updated wordlist
periodically.

My understanding is that sqlite implements ACID compliant transactions
which are inherently thread-safe due to judicious use of locking.  

More info is available at:

   http://en.wikipedia.org/wiki/SQLite
   http://en.wikipedia.org/wiki/ACID

HTH,

David



More information about the Bogofilter mailing list