Async I/O
Async I/O
Posted Apr 10, 2009 5:26 UTC (Fri) by bojan (subscriber, #14302)In reply to: Async I/O by butlerm
Parent article: Linux Storage and Filesystem workshop, day 1
No entirely true, actually. Imagine two processes reading the same file "foo". After they read it, they make the changes in memory, write them out to "foo.new" and then rename into "foo". Which changes will persist? From the fist or the second process?
You have to have some kind of synchronisation to do this (flock(), semaphore etc.). Which can also be applied to the example with "foo~" files to sync access. That's why Gnome has a daemon (i.e. single process) to manage all these changes.
PS. Of course, fbarrier() is still a much better solution, cleaner etc., but you cannot just say that multiple processes can do this as the please.
