3 ms·
Also, beyond only the state in the file being inconsistent, even if you manage to get a complete atomic write of your program state before you crash, the very s
by ninkendo 13y ago
Also, beyond only the state in the file being inconsistent, even if you manage to get a complete atomic write of your program state before you crash, the very same program state that caused the crash (if the crash was your own program's fault) is now being faithfully read back from disk! You're just asking to crash again immediately by blindly loading it all back.
- marvy 13y agoIndeed. Just like this: http://thedailywtf.com/Articles/Serial-Port-Pit-Bull.aspx http://thedailywtf.com/Articles/Serial-Port-Pit-Bull.aspx
- hyc_symas 13y agoThis is why you must have ACID transactions to use this approach. Even without mmap, if your program successfully writes an invalid data structure to disk, the next time you run and read it back, you will crash. That's orthogonal to the method used to write and read the program state.