On Thu, Jun 27, 2013 at 1:01 PM, alexander golks <a...@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 > setter/getter > functions. > > 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 simplistic requirement. 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. Thanks, -mandeep > and: > 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@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest > >
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest