Results 1 to 2 of 2
Does anyone know how multi-process safe the Perl dbm databases are? (I guess genlee will be the one to answer this...) If I didn't make myself clear enough, my intention ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 02-13-2003 #1
- Join Date
- Oct 2001
- Täby, Sweden
Does anyone know how multi-process safe the Perl dbm databases are? (I guess genlee will be the one to answer this...)
If I didn't make myself clear enough, my intention is to have the same dbm database opened by several perl processes, and I want to make sure mainly two things: that no perl process caches any data locally, and that I don't take any risks by letting processes write arbitrary records without locking the file.
- 02-13-2003 #2
- Join Date
- Jan 2003
- Lebanon, pa
Perl has its own lock function which calls flock() to do file locking (perldoc -q lock for more info). Check out a module calle DB_File which I think would be good for this. It can do locking, insert, update, delete and can create an index. I also believe GDBM has built in locking as well but I have never used it. I normally store everything in mysql if I need a database. As of right now, I am not sure how you would clear the read cache without closing then opening the db again. I'll check around and let you know if I find anything.