Messages in this thread | | | From | "David Schwartz" <> | Subject | RE: Lockless file reading | Date | Thu, 28 Aug 2003 02:17:55 -0700 |
| |
> That was my original plan, to just rely on such kernel behaviour. I just > don't know if it's such a good idea to rely on that, especially if I > want to keep my program portable. I'll probably fallback to that anyway > if my checksumming ideas won't work.
If you only have one writer, why not have the writer update an MD5 checksum in the file along with the datawrite? If the reader sees an invalid checksum, it repeats the read. This is simple, elegant, and foolproof. The only possible flaw would be if you found two data sets with the same MD5 checksum. The instant fame would be well worth the inconvenience. ;)
DS
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |