[Interest] Simple doubt on file i/o
alex at golks.de
Thu Jun 27 09:31:15 CEST 2013
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
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".
pay attention to thread-safety if you need it.
* An honest tale speeds best being plainly told.
* -- William Shakespeare, "Henry VI"
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 198 bytes
Desc: not available
More information about the Interest