<div><div class="gmail_quote">On Fri, Jan 14, 2011 at 9:00 AM, Andreas Pakulat <span dir="ltr"><<a href="mailto:apaku@gmx.de">apaku@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
see below, its a much more elegant solution than using a mutex and<br>
possibly faster too. So maybe we can use this to get rid of the mutex in<br>
the cmake manager for the regexp's its using?<br>
<br>
Andreas<br>
<br>
----- Forwarded message from Thiago Macieira <<a href="mailto:thiago@kde.org">thiago@kde.org</a>> -----<br>
<br>
Date: Fri, 14 Jan 2011 01:17:24 +0100<br>
From: Thiago Macieira <<a href="mailto:thiago@kde.org">thiago@kde.org</a>><br>
To: <a href="mailto:kde-core-devel@kde.org">kde-core-devel@kde.org</a><br>
Subject: Re: Multiple QRegExp crashes when multithreading in KRunner<br>
User-Agent: KMail/4.6 beta3 (Linux/2.6.35.6-desktop-1mnb; KDE/4.5.86; i686;<br>
git-3cbb929; 2010-12-23)<br>
<br>
On Thursday, 13 de January de 2011 23:33:14 Milian Wolff wrote:<br>
> Matthias Fuchs, 13.01.2011:<br>
> > Hi,<br>
> ><br>
> > There are some crashes related to QRegExp and multithreading, so they<br>
> > appear when using KRunner.<br>
><br>
> QRegExp is not threadsafe, you either have to guard it with a mutex or make<br>
> sure it's not shared between threads.<br>
<br>
You're right.<br>
<br>
To be clear: as per Qt terminology, QRegExp is reentrant, not thread-safe.<br>
<br>
That means you can use QRegExp in different threads, at the same time, provided<br>
that they point to different objects. If it's the same object, do as Milian<br>
said.<br>
<br>
It's easier to just create a copy in this case.<br>
--<br>
Thiago Macieira - thiago (AT) <a href="http://macieira.info" target="_blank">macieira.info</a> - thiago (AT) <a href="http://kde.org" target="_blank">kde.org</a><br>
Senior Product Manager - Nokia, Qt Development Frameworks<br>
PGP/GPG: 0x6EF45358; fingerprint:<br>
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358<br>
<br>
<br>
<br>
----- End forwarded message -----<br>
<br>
--<br>
Future looks spotty. You will spill soup in late evening.<br>
<font color="#888888"><br>
--<br>
KDevelop-devel mailing list<br>
<a href="mailto:KDevelop-devel@kdevelop.org">KDevelop-devel@kdevelop.org</a><br>
<a href="https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel" target="_blank">https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel</a><br>
</font></blockquote></div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8">Milian got rid of it already, IIRC, he changed it to regular code and it was still fine :P.<div><br></div><div>I don't see what's the better solution, though..</div>
<div><br></div><div>Aleix</div></div>