3 ms·
I’m probably dumb, but isn’t a possible solution to this to leave a single atomic write for the very last operation after a chain of work that was done, one tha
by SV_BubbleTime 5y ago
I’m probably dumb, but isn’t a possible solution to this to leave a single atomic write for the very last operation after a chain of work that was done, one that flags “there is good data here”?
- kevin_thibedeau 5y agoYou would need something that is unlikely to happen from random chance like a valid CRC over the block of data. A flag won't cut it since you can't make any guarantees about data integrity when the system is being torn down mid-write.
- SV_BubbleTime 5y agoSure, but if we’re talking a 32bit system, a magic number can be your final atomic. Agreed. If you were talking an 8bit system, you could 32bit CRC your actual data. Even though the CRC would be 32bits and 4 stores, it wouldn’t be “set” until the final atomic write.