Not sure if useful enough for batteries, but I found this code nice for coarse-grained concurrent updates on files.
high level file locking file interface
I like the idea behind the code, although it needs a self-test before we can accept it.
I agree, but I'm not sure of how to test this. It requires some form of threading/forking to be able to concurrently access a file, yet check that race conditions do not occur. This might raise more questions about how to test the threaded part of batteries...