Re: Problem with DBM concurrent access

2002-04-05 Thread Andrew Ho
Hello, DW>I would also suggest using BerkeleyDB.pm, but with the DW>DB_INIT_MPOOL|DB_INIT_CDB flags. In this mode, only one writer is DW>allowed at a time, and Berkeley automatically handles all the locking DW>and flushing. Just don't forget to use db_close() to close the file DW>before untie

Re: Problem with DBM concurrent access

2002-04-05 Thread Dan Wilga
I would also suggest using BerkeleyDB.pm, but with the DB_INIT_MPOOL|DB_INIT_CDB flags. In this mode, only one writer is allowed at a time, and Berkeley automatically handles all the locking and flushing. Just don't forget to use db_close() to close the file before untie'ing it. Dan Wilga

Re: Problem with DBM concurrent access

2002-04-04 Thread Perrin Harkins
> > Isn't that just as simple as > > > > tied(%dbm_array)->sync(); > > I believe that's not enough, because the reader may read data during the > write, resulting in corrupted data read. Not only that, there's also the issue with at least some dbm implementations that they cache part of the file

Re: Problem with DBM concurrent access

2002-04-04 Thread Joshua Chamas
Stas Bekman wrote: > > > tied(%dbm_array)->sync(); > > I believe that's not enough, because the reader may read data during the > write, resulting in corrupted data read. You have to add locking. see > the DBM chapter in the guide. > You might add MLDBM::Sync to the docs, which easily adds loc

Re: Problem with DBM concurrent access

2002-04-04 Thread Stas Bekman
Rob Bloodgood wrote: >>So my question narrows down to : >>How to flush on disk the cache of a tied DBM (DB_File) structure >>in a way that any concurrent process accessing it in *read only* mode >>would automatically get the new values as soon as they >>are published (synchronisation) >> > > Isn'

RE: Problem with DBM concurrent access

2002-04-04 Thread Rob Bloodgood
> So my question narrows down to : > How to flush on disk the cache of a tied DBM (DB_File) structure > in a way that any concurrent process accessing it in *read only* mode > would automatically get the new values as soon as they > are published (synchronisation) Isn't that just as simple as ti

Re: Problem with DBM concurrent access

2002-04-04 Thread Perrin Harkins
Franck PORCHER wrote: > So my question narrows down to : > How to flush on disk the cache of a tied DBM (DB_File) structure > in a way that any concurrent process accessing it in *read only* mode > would automatically get the new values as soon as they > are published (synchronisation) You have t

Problem with DBM concurrent access

2002-04-04 Thread Franck PORCHER
Hi there, I have a quick and possibly trivial question that has bothered me for quite a while. I'm using a DBM as a repository. The DBM is constantly written to by only one process (the 'writer') that opens it RW. At the same time, many process (the 'reader') access it *read only*. I experience