On Tue, 20 Mar 2001, Perrin Harkins wrote:

> On Tue, 20 Mar 2001, Stas Bekman 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?
> >
> > Well, I wrote this based on my experience. I've used the code that does
> > locking coupled with sync() and it worked fine.
>
> You mean with DB_File?  There's a big warning in the current version
> saying not to do that, because there is some initial buffering that
> happens when opening a database.

The warning says not to lock on dbm fd but an external file! That's where
the problem happens.
http://perl.apache.org/guide/dbm.html#Flawed_Locking_Methods_Which_Mus If
you lock before you tie, and flush before you untie (or change the lock
type), it should be safe.



_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Reply via email to