KConfig/KLockFile performance (was KMimeType performance)

Thiago Macieira thiago at kde.org
Tue Oct 9 20:09:02 BST 2007


David Faure wrote:
>On Tuesday 09 October 2007, Maksim Orlovich wrote:
>> KDesktopFile/KConfig tries to lock the file with KLockFile
>
>Huh. I thought we got rid of the "bool readonly" because it made no
> behavior difference, but if KConfig locks the file then surely we need
> a "ReadOnly" flag again? Or better: we should lock at the time of
> writing to the file, not when just reading from it!

That depends on how the writing is done.

Is it done via write-to-new-file + rename? If so, then there's no problem 
locking only on write[1].

On the other hand, if we're writing to the file that is being read, this 
can introduce problems. So the lock must be for both reading and writing.

[1] AFAIK, you can't rename or delete a file that is open and/or in use on 
Windows. In other words, locking is mandatory and implemented by the 
platform.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071009/5ea430f8/attachment.sig>


More information about the kde-core-devel mailing list