[RFC] Allowing write locks with in read locks
Gary van der Merwe
garyvdm at gmail.com
Mon Jun 28 11:48:56 BST 2010
In bzr, commands are generally either a read command, or a write
command. But in gui's a one can do a write action from read command
window. E.g. tag in log, revert in browse.
After encountering Bug #133220 in bzr-gtk, when working on qbzr, I
took the design approach to hold locks for a short a time as possible:
e.g. for qlog we:
* take read lock
* read graph
* read revision currently on screen
* unlock
(user scrolls)
* take read lock
* read revision currently on screen
* unlock
Then if the user tries to do a read action, the lock will be able to be taken.
Andrew Bennetts pointed out to me at UDS that this will not result in
optimal performance. Not only due to the cost of taking the lock, but
also invalidation of caches.
I feel that a solution where we unlock read locks when we need a write
lock (like I submitted for Bug #133220) is messy, and should be
avoided.
Hence I would like if bzrlib allowed write locks to be taken from
within read locks.
This would be useful for other things, such history-cache and shallow branches.
Would this be possible? What would be needed to be done to achieve this?
https://bugs.launchpad.net/bzr-gtk/+bug/133220
More information about the bazaar
mailing list