Re: Lockless file reading

From: Nagendra Singh Tomar (nagendra_tomar_at_adaptec.com)
Date: 08/27/03

  • Next message: Martin Konold: "Re: Lockless file reading"
    Date:	Thu, 28 Aug 2003 02:45:25 +0530 (IST)
    To: Timo Sirainen <tss@iki.fi>
    
    

    On Thu, 28 Aug 2003, Timo Sirainen wrote:

    > On Wed, 2003-08-27 at 21:42, Nagendra Singh Tomar wrote:
    > > Hi,
    > > 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 ??

    >
    > > Why do u require file locking if there is a *single* writer ?? I don't
    >
    > > understand why a 123 written over XXX can result in 1X3. The kernel
    > should
    > > take care of this. When the writer process is writing 123 it will
    > first be
    > > written to the page cache. The page cache lock will be taken inside
    > the
    > > kernel before writing to it, so we know that writing 123 over XXX will
    > be
    > > atomic. Now even when this page is flushed to disk, the page lock
    > would
    > > be taken. So I cannot see a possibility of 123 written over XXX being
    > read
    > > as 1X3.
    >
    > 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.

    tomar
    >
    >

    -
    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/


  • Next message: Martin Konold: "Re: Lockless file reading"

    Relevant Pages

    • Unable to set reading speed with newer DVD -reader.
      ... # # With DVD-Video -disk in reader. ... Mar 11 23:11:07 tienel kernel: ATAPI device hdb: ... 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/ ...
      (Linux-Kernel)
    • Re: Time sliced CFQ io scheduler
      ... progress as long as the reader is going. ... writes like reads internally and given the really bad fairness problems ... for getting a good feel for N client read/write performance. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: RTL8139, the final patch ?
      ... > I know use Fedora Core 4 on this box. ... this was my original post. ... issue and some of them mail me, so I have a prepared mail :-) ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Why reply at the bottom of posts?
      ... > I'm just curious as to why so many replies are under the original post ... > What news reader are folks using that does this? ... In news groups, where threads are deep, I think bottom-posting makes for ... usually scrolls to the bottom in a flash. ...
      (microsoft.public.windowsxp.general)
    • Re: {Anime} Wild RNG mood swings
      ... The subject of the original post did indeed have at the beginning, ... It is your reader that _removed_ it, ... reader not the original poster that was at fault. ... players without automatically knowing where the player is - randomly roaming ...
      (rec.games.roguelike.angband)