[thiago at kde.org: Re: Multiple QRegExp crashes when multithreading in KRunner]

Aleix Pol aleixpol at kde.org
Fri Jan 14 08:36:24 UTC 2011


On Fri, Jan 14, 2011 at 9:00 AM, Andreas Pakulat <apaku at gmx.de> wrote:

> Hi,
>
> see below, its a much more elegant solution than using a mutex and
> possibly faster too. So maybe we can use this to get rid of the mutex in
> the cmake manager for the regexp's its using?
>
> Andreas
>
> ----- Forwarded message from Thiago Macieira <thiago at kde.org> -----
>
> Date: Fri, 14 Jan 2011 01:17:24 +0100
> From: Thiago Macieira <thiago at kde.org>
> To: kde-core-devel at kde.org
> Subject: Re: Multiple QRegExp crashes when multithreading in KRunner
> User-Agent: KMail/4.6 beta3 (Linux/2.6.35.6-desktop-1mnb; KDE/4.5.86; i686;
>        git-3cbb929; 2010-12-23)
>
> On Thursday, 13 de January de 2011 23:33:14 Milian Wolff wrote:
> > Matthias Fuchs, 13.01.2011:
> > > Hi,
> > >
> > > There are some crashes related to QRegExp and multithreading, so they
> > > appear when using KRunner.
> >
> > QRegExp is not threadsafe, you either have to guard it with a mutex or
> make
> > sure it's not shared between threads.
>
> You're right.
>
> To be clear: as per Qt terminology, QRegExp is reentrant, not thread-safe.
>
> That means you can use QRegExp in different threads, at the same time,
> provided
> that they point to different objects. If it's the same object, do as Milian
> said.
>
> It's easier to just create a copy in this case.
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>  Senior Product Manager - Nokia, Qt Development Frameworks
>      PGP/GPG: 0x6EF45358; fingerprint:
>      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
>
>
>
> ----- End forwarded message -----
>
> --
> Future looks spotty.  You will spill soup in late evening.
>
> --
> KDevelop-devel mailing list
> KDevelop-devel at kdevelop.org
> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
>

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..

Aleix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20110114/fc5a7604/attachment.html>


More information about the KDevelop-devel mailing list