<story><title>Everything you never wanted to know about file locking</title><url>http://apenwarr.ca/log/?m=201012#13</url></story><parent_chain></parent_chain><comment><author>tedunangst</author><text>Every BSD system I&apos;m aware of has something called lockf, which may or may not be layered on top of flock (or the other way around).&lt;p&gt;Note that all of these locking schemes fall down hard on NFS, depending on client and server, regardless of what any man pages say about support.  Homework question: How does a stateless protocol like NFS remember when one client locks a file and a different client tries locking it?&lt;p&gt;The failure mode on NFS can vary from &quot;lock always succeeds, regardless of actual status&quot; to &quot;lock always fails, hanging forever&quot;, or my favorite, &quot;locks work, unless your process crashes, and then you can never lock that file again until you reboot the NFS server&quot;.</text></comment>
<story><title>Everything you never wanted to know about file locking</title><url>http://apenwarr.ca/log/?m=201012#13</url></story><parent_chain></parent_chain><comment><author>tptacek</author><text>Worth reading all the way to the bottom; the Python stuff made me giggle.</text></comment>