Review Request 121817: Fix for crash which was introduced by RR 121480 (use QCollator instead of KStringHandler)
Emmanuel Pescosta
emmanuelpescosta099 at gmail.com
Sun Jan 4 20:39:56 GMT 2015
> On Jan. 4, 2015, 7:09 p.m., Frank Reininghaus wrote:
> > This looks like it should fix the crash indeed, thanks!
> >
> > Something that we might want to keep in mind is to check if there is now more collator-copying than needed. At first sight, it looks like a copy of the collator will be created not only when a new thread is forked, but every time a recursive call is made in kfileitemmodelsortalgorithm.h, right? I'm not sure how expensive creating a new collator is, but it might be worth investigating that (but after this commit is pushed - better fix this crash first and then look at the performance later).
> but every time a recursive call is made in kfileitemmodelsortalgorithm.h, right?
Yes you are right!
But compared to sorting creating collator instances should be relatively cheap, thus I decided to take the easy route (creating collator instances in the copy ctor) ;)
> better fix this crash first and then look at the performance later
+1
- Emmanuel
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121817/#review73089
-----------------------------------------------------------
On Jan. 3, 2015, 11:22 p.m., Emmanuel Pescosta wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121817/
> -----------------------------------------------------------
>
> (Updated Jan. 3, 2015, 11:22 p.m.)
>
>
> Review request for Dolphin.
>
>
> Bugs: 342316
> http://bugs.kde.org/show_bug.cgi?id=342316
>
>
> Repository: kde-baseapps
>
>
> Description
> -------
>
> While porting away from KStringHandler::naturalCompare to QCollator::compare, I had thought that QCollator is an drop-in replacement for KStringHanlder (also regarding to thread safety) - but according to the docs it's reentrant only (sry I missed that), surprisingly sorting with multiple threads never crashed here.
>
> To fix the issue, we create a new thread local QCollator instance for every thread.
>
>
> Diffs
> -----
>
> dolphin/src/kitemviews/kfileitemmodel.h df7a5e3
> dolphin/src/kitemviews/kfileitemmodel.cpp 1c92a2c
>
> Diff: https://git.reviewboard.kde.org/r/121817/diff/
>
>
> Testing
> -------
>
> Kai and Lane tested this patch and they confirmed that the patch fixes the crash for them.
>
>
> Thanks,
>
> Emmanuel Pescosta
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20150104/0c68445d/attachment.htm>
More information about the kfm-devel
mailing list