KConfig race condition?

Rob Kaper cap at capsi.com
Mon Apr 19 18:16:44 BST 2004


I'm having a problem where two applications want to update KConfig at the
same time. Both application instances receive a notification to store a key
(a cookie*), but it has happened where the save of the second application
undid the change by the first. Should I reload the configuration always
before saving it (seems like that still wouldn't guarantee success) or is
there a proper way?

One solution would be if KConfig, when saving its configuration, kept
entries in the file it doesn't have itself, only removing items that were
specifically removed by the application.

Alternatively, using kcookiejar for this seems perfect, except I don't know
how well that can be used for non-HTTP cookies. Would it be feasible and
desirable to extend the cookiejar to allow for different kinds of cookies?

* Atlantik receives a cookie from monopd so players can continue games if
for some reason their network or application hickups or is accidentely shut
down.

Rob
-- 
Rob Kaper     | 4/16 Horrorpops COPENHAGEN, 4/29 The Rasmus LONDON
cap at capsi.com | 5/11 Ghost of the Robot AMSTERDAM, 5/14 Disney PARIS
www.capsi.com | 7/19 COPENHAGEN-MALMÖ, 7/21 STOCKHOLM-KÖPING, 8/1 OSLO
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040419/cddbe43b/attachment.sig>


More information about the kde-core-devel mailing list