Philip Martin <philip.mar...@wandisco.com> writes: > Holding the write lock will block readers so for better concurrency we > want to minimise the time that a write lock is held, or have more locks.
Daniel pointed out that readers don't block, they simply read the pack file and get either the old or atomically replaced new file. Thus there is no need to minimise lock time for readers, and we can design the the locks to minimise write IO. So we want the lock held for the whole read/write/replace operation so that concurrent writers don't do IO that has to be thrown away. One lock per pack file will allow concurrent writes to different shards and so would help with write concurrency if that is important. -- uberSVN: Apache Subversion Made Easy http://www.uberSVN.com