[lkml]   [2003]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Lockless file reading
On Thursday, Aug 28, 2003, at 04:50 Europe/Helsinki, Jamie Lokier wrote:

>> checksum[0]++;
>> xor = buf[0] ^ checksum[0];
> Your algorithm isn't going to work if the new value of xor is the same
> as the old value of xor.

I was trying to prevent it with the checksum[0]++ .. but yes, you're

I'm sure someone has figured out a way to make a checksum of data that
can detect if there's even a single bit wrong, if the checksum is
allowed to take as much space as the data itself. I should read more
about algorithms..

How about checksum[n] = data[n-1] ^ data[n]? That looks like it would

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:48    [W:0.119 / U:1.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site