3 ms·
"explicitly choosing a file and mapping that into the memory space of the program means it can persist across crashes" It's not that your program crashes, it's
by guard-of-terra 13y ago
"explicitly choosing a file and mapping that into the memory space of the program means it can persist across crashes"
It's not that your program crashes, it's that your memory becomes corrupt and that causes the crash.
Restarting program is essentially redoing all the memory. If you persist your memory your program will crash on run.
- IgorPartola 13y agoDifferent types of crashes and different memory. You can crash because you program did not handle a network error well, etc. Also, you do not need to use mmap'ed memory for everything. You can still use the stack and the heap for temporary structures, but store permanent data in the mmap'ed segments. Think about persistent data vs running queries in a database server.
- guard-of-terra 13y agoHow is it then different from sqlite?
- IgorPartola 13y agoI don't know how sqlite3 works so I cannot tell you, but it sounds like a pattern that would fit it well.
- mtdewcmu 13y agoSQLite does it for you; here you do it yourself. Presumably you'd have done a cost/benefit analysis before choosing this over SQLite, so your reasoning would be sound...