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

Re: [PATCH] db/gdbm rewrite



On Sun, Feb 19, 2017, at 10:19 AM, Bart Schaefer wrote: 
> 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

Ah, I had a matrix on my eyes and read GDBM_SYNC as GDBM_LOCK.

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

It must be for multiple threads. Sorry for not reading the docs doing
update, but by testing gdbmtool behavior I have got correct image:
- database access is guarded by locks
- writing to single file by 2 threads without locking corrupts database
- gdbm isn't a server and doesn't order transactions with a level of
concurrency

We could update db_gdbm to use GDBM_NOLOCK and seamlessly ~PM_UPTODATE,
providing a zgdbmlock builtin. I did a good thing with PM_UPTODATE, all
doors are open.

-- 
Sebastian Gniazdowski



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