decide a formal lock is called for, then the issue of granularity comes into play: Do I lock the whole thing for the whole time? Do I lock just my files for the whole time? Do I lock just my files for part of the time? Or do I perform some combination thereof? There are several formal locking solutions to choose from, each with their own benefits and drawbacks:
Full Codeline-Lock is usually the easiest to implement, but is also the most pessimistic since it locks the entire codeline. Use it when formal locking is desired but completion-overlap is rare and non-collision conflicts are a serious concern (due either to risk or cost).
Partial Codeline-Lock is the most optimistic of the formal locking strategies but is not as simple or easy to implement as full locking (unless the version-control tool already supports it). Partial locking is ideal when completion-overlap is common (particularly near the end of an iteration/release).
Double-Checked Codeline-Lock is appropriate when commit-contention and completion overlap are both common and when the set of modified files is non-trivial in size or takes a non-trivial amount of time to checkout (long enough so that contention even just during the time it takes to obtain the lock is a legitimate concern). Unless your version-control tool implements this automatically, it is typically the most effort to implement of the formal locking strategies discussed here.
Phased Codeline-Lock is appropriate when completion-overlap is common during Codeline Commit Preparation activities but not during Task-Level Commit, and non-collision conflicts are a serious concern (due either to risk or cost).
- Software Configuration Management Patterns , by Stephen P. Berczuk and Brad Appleton; Addison-Wesley, November 2002 (see http://www.scmpatterns.com)
- Configuration Management Models in Commercial Environments , by Peter Feiler; SEI Technical Report CMU/SEI-91-TR-7 , March 1991
- Version Management with CVS , by Per Cederqvist et.al.; http://www.cvshome.org/docs/manual
- Version Control with Subversion , by Ben Collins-Sussman et.al.; http://svnbook.red-bean.com
- Transaction-Oriented Configuration Management , by Peter Feiler and Grace Downey; SEI Technical Report CMU/SEI-90-TR-23 , November 1990