File locking best practices and specific use case scenarios