[thiago at kde.org: Re: Multiple QRegExp crashes when multithreading in KRunner]
Andreas Pakulat
apaku at gmx.de
Fri Jan 14 10:29:33 UTC 2011
On 14.01.11 10:54:41, Milian Wolff wrote:
> On 01/14/11 09:36, Aleix Pol wrote:
>> Milian got rid of it already, IIRC, he changed it to regular code and it
>> was still fine :P.
>>
>> I don't see what's the better solution, though..
>
> The better solution would be to copy the static regexp data into a local
> variable. It might indeed be faster than a mutex thingy, and definitely
> faster than creating the regexp from a string representation all the
> time. Anyways, for CMake I removed the usage of QRegExp in that one
> position alltogether and replaced it with simple QString operations.
Ah, now that you mention it I recall having seen that commit :)
> This is faster than all of this ;-) There might be more cases where we
> use QRegExp though, and we should benchmark this and see wether it's
> worth it.
Hmm, might be worth it even without a speed-increasement, simply for easier
code-understanding. In particular if people copy the pattern to their own
code and don't know too much about threading.
Andreas
--
You will be singled out for promotion in your work.
More information about the KDevelop-devel
mailing list