Quote:
Originally Posted by kovidgoyal
No, it is mandatory. On windows, all files are locked as soon as they are opened, unless the application specially opts to use a file sharing mode. And both applications have to use the file sharing mode when opening files for sharing to work.
In contrast in POSIX file locking is advisory, opening files does not lock them unless the application asks for them to be locked and both applications have to ask for the lock for locking to work.
|
It maybe didn't apply to Win 3.x & Win9x etc but only NT as NT from NT 3.1 in 1993 used files as part of virtual memory to reduce usage of the swap file and improve performance, though I had assumed it was only program files, not data. But also there was a mode were instead of File I/O an NT program (not Windows on DOS boot which even ME as well as win9x is) could access a file as if it was an array in (virtual) memory.
Hence the logic of file locking on NTFS unless both (all) programs opened explicitly in shared mode.