Perrin Harkins wrote:
>
> Is anyone aware of a safe to way to do multi-process read/write access
> through a dbm module other than BerkeleyDB.pm without tie-ing and
> untie-ing every time?  I thought that was the only safe thing to do
> because of buffering issues, but this seems to be implying that careful
> use of sync calls or something similar would do the trick.  Maybe this is
> just left over from before the problem with the old technique described in
> the DB_File docs was discovered?  Any comments?
>

I don't know how to do it safely, which is why I do the 
tie/untie in MLDBM::Sync in a locked critical section.

I know the tie/untie MLDBM::Sync strategy with DB_File is
slow, but what size data are you caching?  It may be that
you can use MLDBM::Sync with SDBM_File, with records < 100 bytes
would be good, or MLDBM::Sync with MLDBM::Sync::SDBM_File
which faster through around 5000-10000 byte records with
Compress::Zlib installed.  Generally, the tie/untie with 
a SDBM_File is pretty fast.

Otherwise, DeWitt Clinton's Cache::Cache might also do it for
you, as the file based cache is probably faster than DB_File
with tie/untie per access for large records.

--Josh

_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks >> free web link monitoring   Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

Reply via email to