5 ms·
In other words, what the osx default fsync() semantics is useful for? I had the same discussion on Twitter a few days ago...
by antirez 13y ago
In other words, what the osx default fsync() semantics is useful for? I had the same discussion on Twitter a few days ago...
- Someone 13y agoIt is useful for forcing all writes out to the storage device. If you device is battery/UPS backed, has enough capacity to flush its buffers (to disk or to flash memory) after a power loss, that is sufficient to (eventually) get your data on disk (yes,the drive may fail, but if that happens after the data has hit the platter, you have no guarantees, either) From what I understand, that behaviour is in spec (for me, borderline, at best, but I don't make that spec) according to http://pubs.opengroup.org/onlinepubs/009695399/functions/fsync.html http://pubs.opengroup.org/onlinepubs/009695399/functions/fsy... ("physical write from the buffer cache", not "physical write to the disk") and, AFAIK, is what others do, too (http://ridiculousfish.com/blog/posts/mystery.html http://ridiculousfish.com/blog/posts/mystery.html) Edit: http://lists.apple.com/archives/darwin-dev/2005/Feb/msg00072.html http://lists.apple.com/archives/darwin-dev/2005/Feb/msg00072..., referenced from that ridiculous fish post, gives more background info.
- antirez 13y agoOk makes sense in special cases indeed, however a really unsafe default...