To reduce the chance of lock contention, locks should only be put in effect when the code accesses data that is sensitive to concurrent access.