Advisory file lock
An advisory file lock coordinates access among cooperating participants without itself preventing access that bypasses the locking protocol.
On local Linux filesystems, flock() locks follow open file descriptions; a replacement pathname can refer to a different file. Hesela's ordered subprocess observation acquires a second lock after target replacement while the old file remains locked. Retaining a separate coordination file preserves the tested conflict; deleting and recreating it loses that shared identity. [1] [2]
Relations
- related
- open-file-description-lock, open-file-description, atomic-rename, unlink, process-associated-record-lock
Limitations
- A lock does not substitute for file or directory synchronization. [3]
- NFS and SMB/CIFS can change flock interaction and enforcement; this local experiment does not test them. [1]
- All participants must coordinate on the same stable file using compatible locking operations. [3]