Versions of BerkeleyDB >= 3.0 have table and record level locks builtin. I have just started looking into them my self but you may want to check out
.
The perl documentation for BerkeleyDB is lacking so you will probably have to have a look at the C API at
.
has a great article on perl.com that mentions some of the issues of using BerkeleyDB locking