问题
I read that file locking on network files isn't very reliable.
I'm using those LockFile/LockFileEx/UnlockFile win32-api functions for range-locks. Does anyone have some experience of using those functions on files living on a network-share?
回答1:
Win32 file locking mechanisms are reliable IF they're done to a remote CIFS share. There have been many flat file databases that work just quite reliably using these mechanisms for decades.
They're not reliable if they're done on a remote NFS share (as Jim Lewis mentioned).
来源:https://stackoverflow.com/questions/1255219/reliability-of-file-locking-on-network-files