I am trying to implement a file storage mechanism that contains several records with a variable size in one file with the guarantee that the recordset will always be restored to a consistent state, even if the system failed at a hardware level.
So far, every circuit I came across comes down to writing data sequentially. Some data will be added to the end of each record, which confirms that the record is complete. However, if the data is not necessarily written to the disc sequentially during blurring, then confirmation data can be written before the content data.
There are two obvious ways, but both are undesirable:
- Discard the contents, then write a confirmation and rinse it. Adding an additional flush may degrade performance.
- Include the checksum in the confirmation (you will need to read the contents to confirm that it is valid).
I use C # for Windows (32 and 64-bit) and a .NET memory card.
recovery paging memory-mapped-files
Kennet belenky
source share