It is best to use locks only when you need them. Don’t lock files just because you think you might need to edit them. Don’t lock whole directories—lock only the specific files you need. Don’t hold locks any longer than necessary.