]> git.ipfire.org Git - thirdparty/squid.git/commit - src/ipc/Makefile.am
Split Rock-only Rock::DirMap into Rock::DirMap and reusable Ipc pieces
authorAlex Rousskov <rousskov@measurement-factory.com>
Sat, 9 Apr 2011 04:24:06 +0000 (22:24 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Sat, 9 Apr 2011 04:24:06 +0000 (22:24 -0600)
commit44c95fcf593ff4c2e27107d0f6d4091840737032
tree6e6707e0f9655f62c780a7731d74b8d88634f08f
parent937d0d3f1a1ba2a07def3bf46418d46146feaa4d
Split Rock-only Rock::DirMap into Rock::DirMap and reusable Ipc pieces
which a shared memory cache implementation can use:

Ipc::StoreMap is responsible for maintaining a collection of lockable slots,
each with readable/writeable/free state and a "waiting to be free" flag. Kids
of this class can add more metadata (in parallel structures using the same
index as primary slots). I tried extending the slots themselves, but that
turned out to be more complex/messy.

Ipc::ReadWriteLock is a basic multiple readers, single writer lock.  Its
earlier implementation inside Rock::DirMap mixed slot locking and slot
state/flags. That simplified the caller code a little, but the current simpler
class is easier to understand and reuse.

Rock::DirMap now just adds Rock::DbCellHeader metadata to Ipc::StoreMap slots.

Simplified mapping API by reducing the number of similar-but-different
methods. For example, instead of putAt, the caller can use an
openForWriting/closeForWriting pair. This helps with moving custom metadata
manipulations outside of the reusable Ipc::StoreMap.

It would be possible to split Ipc::StoreMap further by moving Store-specific
bits outside of its slots. Currently, there is no need for that though.
src/fs/rock/RockDirMap.cc
src/fs/rock/RockDirMap.h
src/fs/rock/RockSwapDir.cc
src/ipc/Makefile.am
src/ipc/ReadWriteLock.cc [new file with mode: 0644]
src/ipc/ReadWriteLock.h [new file with mode: 0644]
src/ipc/StoreMap.cc [new file with mode: 0644]
src/ipc/StoreMap.h [new file with mode: 0644]