[TriLUG] Fwd: Why do File IO event seem to be out-of-order in strace?

Igor Partola via TriLUG trilug at trilug.org
Tue Sep 15 14:13:26 EDT 2015


That's what I'm saying: don't lock a byte range. That will not work, not
only because it's just broken on Linux, but because it'll be extremely
difficult to do with an append type file. Instead, just lock the whole
file, do your write and flush, then unlock the whole file. Unless you need
the type of performance that would care about a "global" lock/unlock, don't
bother doing anything else. And if you care about such performance, then
there are a half dozen designs that don't involve a lock at all (such as a
separate writer thread or process).

Igor


More information about the TriLUG mailing list