Ksycoca & QSharedMemory

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Mon Feb 25 07:54:52 GMT 2008


To resolve our problems with the open file handle on ksycoca and the resulting problems on windows (file can't be deleted) I would like to use QSharedMemory to share the ksycoca cache.
Another idea would be to use QFile::map() but this doesn't work on windows too because we can't delete the mapped file (only rename would work) :(

Therefore I would like to create a simple class derived from QIODevice. It would load (if needed) the file into a QSharedMemory segment. There are two memory segments needed. One with the data and one for status informations.
When the file content changes, the process needs to call a function update() which increases a counter in the status information shm. After this it informs the other processes via dbus (like it's done now). They reopen their file handle and attach to the new data shm segment. The old shm segment goeas away after the last one detached from it.

If you don't like the idea for a general usage, I would use it for windows only.

Psst! Geheimtipp: Online Games kostenlos spielen bei den GMX Free Games! 

More information about the kde-core-devel mailing list