Review Request 118985: KSharedConfig: only write to mainConfig and wasTestModeEnabled in the main thread

David Faure faure at kde.org
Sun Jun 29 13:29:03 UTC 2014



> On June 29, 2014, 3:31 a.m., Matthew Dawson wrote:
> > I'm not sure about moving the warning about immutable files to only happen on the main thread, as it is possible that an application may use it KSharedConfig on an alternate thread only.
> > 
> > As this is mainly an optimization, I think the best thing is to just move to using the load() function on the atomic integer, as I believe that doesn't require processors to synchronize, and won't limit optimizations.  Otherwise, I'm fine with the immutable files as that is simpler code wise.  Thoughts?

Well, I'm not sure we'd expect secondary threads to pop up a dialog though (as KConfig::isConfigWritable(true /*warn user*/) does, via QProcess("kdialog")).

This bit (the warnUser code) isn't really about an optimization, but about doing that stuff only in the main thread, where GUI apps initialize the main config object and where user-interaction is expected.


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118985/#review61157
-----------------------------------------------------------


On June 27, 2014, 10:31 p.m., David Faure wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118985/
> -----------------------------------------------------------
> 
> (Updated June 27, 2014, 10:31 p.m.)
> 
> 
> Review request for KDE Frameworks and Matthew Dawson.
> 
> 
> Repository: kconfig
> 
> 
> Description
> -------
> 
> KSharedConfig: only write to mainConfig and wasTestModeEnabled in the main thread
> 
> As a side effect, this removes the need for the atomic ints, since
> that code now only runs in the main thread.
> 
> 
> Diffs
> -----
> 
>   src/core/ksharedconfig.cpp b7d155d5893502921d35d7dd971188b6a93a0620 
> 
> Diff: https://git.reviewboard.kde.org/r/118985/diff/
> 
> 
> Testing
> -------
> 
> no regression in "make test" in kconfig; still debugging races in helgrind threadtest (in kio).
> 
> 
> Thanks,
> 
> David Faure
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140629/49c94e4c/attachment.html>


More information about the Kde-frameworks-devel mailing list