> So maybe the time when you gain an exclusive lock on a file is the > appropriate time to flush your local cache? I used exclusive lock is just for a simplified demonstration. In reality, a shared read lock will be used when just reading from the file is enough. I that case, the right time to flush local cache would be whenever any *lock* is obtained.