file locking

Adrian Otto aotto at aotto.com
Mon Sep 16 20:54:26 CEST 2002


Boris,

> Can you make it so smart it uses the best available method
> of locking without any additional argument?

Because I wanted to allow for easy integration with other programs that
might manage the wordlists independently from bogofilter, like Perl scripts
that have support for flock built in, but not fcntl locks, I thought it
would be beneficial to have bogofilter use flock locking by default if it
could.

Note that some systems implement flock() using fcntl locks underneath. If
you are using one of these systems, then locking over NFS is safe, even when
the lock is set using flock().

Using both flock and fcntl and flock locks at the same time would allow
default support for Perl interoperability, and NFS locking. The problem is
that I'm concerned about running into deadlock conditions with systems that
implement flock with fcntl. I don't want to be blocking on my own lock. I'll
need to do some testing around this to see if this is really a problem or
not.

Adrian


For summay digest subscription: bogofilter-digest-subscribe at aotto.com



More information about the Bogofilter mailing list