Add copy-on-write support.
commit1f741e25b0e1e1d6fde4007d6cb5d433f6adf528
authorBen Kibbey <bjk@luxsci.net>
Sat, 31 Dec 2016 04:28:32 +0000 (30 23:28 -0500)
committerBen Kibbey <bjk@luxsci.net>
Sat, 31 Dec 2016 04:28:32 +0000 (30 23:28 -0500)
tree78b58bc3ba422e76aadfe194a9b34f0e2ec62dcd
parent43f1a8e7f117d85a1ab6a7cefc34b74beaa05510
Add copy-on-write support.

The initial client of a data file decrypts the cached document. When
another client connects, it accesses the same document pointer as the
initial client until one client modifies the document; then a copy is
made for the client that issued the command. Depending on which client
SAVE's first determines which will get the checksum error during the
next command.

When all clients are done with the data file the cache becomes encrypted
again.

This improves both speed and memory for lots of clients using the same
data file since no cache decryption nor document copy needs to be done
for each client.
NEWS
doc/pwmd.html
doc/pwmd.texi
src/cache.c
src/cache.h
src/commands.c
src/common.h
src/crypto.h
src/pwmd.c