- Introduction
- Method 1: Shared Directory
- Method 2: Shared Directory Plus Lock
- Method 3: Mainline Plus Sandboxes
- Method 4: Mainline Plus Sandboxes Plus Synchronization
- A Few More Observations
- Conclusion
Method 2: Shared Directory Plus Lock
In this method, you use a shared directory as before but add a lock so people aren't editing at the same time. (A lock ensures exclusive access to a resource; when someone has the lock, nobody else is allowed to use the resource.)
The lock may be virtual (such as renaming a file), or it can be a physical object (such as a stuffed animal held while the code is locked).
Each pair uses this approach:
Wait until the lock is free.
Lock.
Make changes.
Back up the system.
Unlock.
This strategy has these effects:
Pairs no longer interfere with each other.
The team no longer works in parallel (trading speed for safety).
If all changes are successful, the mainline is in a good state after each release of the lock.
Changes can be transactional; if a set of changes is unsatisfactory, the pair can restore a previous version (abandoning the unwanted changes).