[Interest] Simple doubt on file i/o
mandeepsandhu.chd at gmail.com
Thu Jun 27 10:00:03 CEST 2013
On Thu, Jun 27, 2013 at 1:01 PM, alexander golks <alex at golks.de> wrote:
> > Thoughts?
> i would use a "cache" QMap, and keep it in sync just when needed.
> fill the cache from file on load/construction/first access, write the
> cache to
> file on destruction, thus you won't have any file access during
> you can do file handling in a thread to not block callers,
> you can force a write via timeout signal, e.g.
> "do threaded sync to file after 5 seconds of last change to cache".
I agree with this method, though I believe it's a bit of an overkill for my
Also, after the first access, the contents of the file will be cached in
the filesystem cache itself (which is in memory). Though there'll still be
the overhead of making a syscall to access that.
> pay attention to thread-safety if you need it.
> * An honest tale speeds best being plainly told.
> * -- William Shakespeare, "Henry VI"
> Interest mailing list
> Interest at qt-project.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest