dino has asked for the wisdom of the Perl Monks concerning the following question:
I'm having problems in coding an application that updates a set of counters from multiple sources (tcpdump byte counts).
Originaly I used flock on separate files, but that was too slow. The next trial was with DB_File, that worked well, but I hear there is an issue with locking/corruption. I then tried dbi connecting to a mysql db, but unfortunately and that was also too slow.
I finally tried BerkeleyDB. I was able to use CDS, but it doesn't work for multiple writers (it deadlocked). I've yet to determine how to manually lock an update in such an environment. Any suggestions? Anyone seen a perl example out there? I've had a look at the Oracle site, but I'm finding the C a bit tricky.
Update: Apr 27
There certainly have been many suggestions and thanks to you all. I've done some testing of Cache::FastMmap and it appears to meet most of my needs. I'll also have a look at the source for BerkeleyDB to get a better understanding of how it does locking.