[lkml]   [2003]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Lockless file reading
On Thu, 2003-08-28 at 00:15, Nagendra Singh Tomar wrote:
> > > I beleive ur original post was to address the case of a reader
> > reading
> > > a file getting *incorrect* data due to the file being written
> > > simultaneously by another writer process.
> >
> > Well, "old" data, which mixed with new data would become incorrect as a
> > whole.
> What is this mixing we are talking of ??

I can easily see that the data might be divided into two separate pages
and between updating those pages, another process would have read the
first page, but not the second page. That would result in a mixed old
and new data. Probably just <old><new> or <new><old> instead of
<new><old><new> what I was worrying about, but still it would be nicer
to rely only on byte atomicity and read/write ordering. :)

> > 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.
> But I don't see any problem with a single writer and >=1 reader. There is
> no question of portability.

There are of multiple writers, but it's fine for them to do locking
between each others.

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.117 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site