Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] db/gdbm rewrite

On Feb 19, 12:46am, Sebastian Gniazdowski wrote:
} As the other thread pointed out, GDBM_SYNC flag means no change to
} database can be done, even when opening in read-only mode.

?? That's not what it means at all:

   GDBM_READER reader
   GDBM_WRITER writer
   GDBM_WRCREAT writer - if database does not exist create new one
   GDBM_NEWDB writer - create new database regardless if one exists
   For  the  last  three  (writers  of the database) the following may be
   added added to read_write by bitwise or: GDBM_SYNC, which  causes  all
   database  operations  to be synchronized to the disk, and GDBM_NOLOCK,
   which prevents the library from performing any locking on the database

GDBM_SYNC is meaningless for read-only mode; in any write mode it means
that changes made to by the program are immediately flushed out to the
file, so that other readers can immediately see the change.  Locking is
a separate op.  zsh/db/gdbm does use locking by default (does not pass
teh NOLOCK flag); I have never deeply investigated how gdbm handles that

Man page also says:

   It is important that every file opened is also closed.  This is needed
   to update the reader/writer count on the file.

Why would there be a reader/writer count if there is no concurrent change

Messages sorted by: Reverse Date, Date, Thread, Author