T
Thomas Reat
I have a perl script that maintains its state in a hash of hashes. It
runs all the time. I have another script that must access (read only)
this state. I'd also like to recover it in the event of a restart.
What I'm doing now is to dump it to a file (200kB) every time through
the main loop (every minute or so), despite the fact that the common
case is for there to be no changes. And any changes that are made are
tiny, to only a couple records. Locking is handled by writing to a
temporary file and renaming over the original.
What is an elegant solution for this? I've considered using a real
database, but it seems like overkill. MLDBM looks like it might help
me, but will I be able to have a dbm file opened for writing by one
process and reading by another?
runs all the time. I have another script that must access (read only)
this state. I'd also like to recover it in the event of a restart.
What I'm doing now is to dump it to a file (200kB) every time through
the main loop (every minute or so), despite the fact that the common
case is for there to be no changes. And any changes that are made are
tiny, to only a couple records. Locking is handled by writing to a
temporary file and renaming over the original.
What is an elegant solution for this? I've considered using a real
database, but it seems like overkill. MLDBM looks like it might help
me, but will I be able to have a dbm file opened for writing by one
process and reading by another?