~/talk

Was file locking ever meant to work?

Talkat DevConf.CZ 2019 · 2019-01-25..01-27· [linux-and-operating-systems]
links:none on file
slides:none on file

Compares BSD flock, POSIX fcntl locks and the Linux-only open file description locks, showing concrete failures: BSD can be silently no-op or translate to POSIX on NFS, fcntl releases locks on the first close so threads can accidentally drop locks, and mandatory locks are broken and unsupported. Builds a working libvirt solution using POSIX locks but isolates locking into a short-lived forked helper so locks behave as if single threaded; shows SQLite’s messy pthread+fcntl workaround and explains why PID files safely use BSD locks.

AI-written summary · about

  1. 0:00File locking challenges
  2. 1:33Scenarios requiring file locks
  3. 3:41Types of file locks
  4. 6:12BSD locks inconsistencies
  5. 7:16POSIX locks pitfalls
  6. 10:55Lockf and open file locks
  7. 12:23Mandatory locks risks
  8. 13:06Libvirt's file locking
  9. 15:48Q&A on POSIX locks
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.