zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: [PATCH] db/gdbm rewrite
Date: Sun, 19 Feb 2017 10:19:17 -0800	[thread overview]
Message-ID: <170219101917.ZM22858@torch.brasslantern.com> (raw)
In-Reply-To: <1487494013.288657.885684608.5BB76024@webmail.messagingengine.com>

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
   file.

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
underneath.

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
allowed?


  parent reply	other threads:[~2017-02-19 18:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-19  0:43 (Fwd) " Bart Schaefer
2017-02-19  8:46 ` Sebastian Gniazdowski
2017-02-19  9:01   ` Sebastian Gniazdowski
2017-02-19 18:19   ` Bart Schaefer [this message]
2017-02-20  8:32     ` Sebastian Gniazdowski
  -- strict thread matches above, loose matches on Subject: below --
2017-02-14 12:20 Sebastian Gniazdowski
2017-02-15 10:22 ` Sebastian Gniazdowski
2017-02-16 10:16   ` Peter Stephenson
2017-02-16 11:46     ` Sebastian Gniazdowski
2017-02-16 12:52       ` Peter Stephenson
2017-02-16 14:25         ` Sebastian Gniazdowski
2017-02-16 14:30           ` Sebastian Gniazdowski
2017-02-16 15:11             ` Peter Stephenson
2017-02-16 16:03               ` Sebastian Gniazdowski
2017-02-16 16:25                 ` Sebastian Gniazdowski
2017-02-16 16:36                   ` Peter Stephenson
2017-02-16 17:12                     ` Sebastian Gniazdowski
2017-02-16 18:16                 ` Sebastian Gniazdowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=170219101917.ZM22858@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).