[Development] Is Qt allowed caching the home dir path?

Jiergir Ogoerg f35f22fan at gmail.com
Mon Oct 28 00:18:33 CET 2013


Thanks, looking at qatomic.h it indeed looks like Qt is doing low
level hw/compiler thread related work which is not exposed in the standard
C++ language or in posix.
I didn't expect that, my bad.


On Mon, Oct 28, 2013 at 12:58 AM, Thiago Macieira <thiago.macieira at intel.com
> wrote:

> On segunda-feira, 28 de outubro de 2013 00:38:51, Jiergir Ogoerg wrote:
> > Probably, but then afaik it either (a) somehow can create barriers or (b)
> > implements
> > a broken but good enough solution like DCLP (double checked locking
> > pattern),
> > I couldn't figure out cause it uses Qt specific macros and functions.
>
> It has two implementations:
>
> 1) using a mutex by QMutexPool, with a non-broken double-checked locking
> (because the flag is stored in a QBasicAtomicInt)
>
> 2) using the compiler's thread-safe function-local static initialisation,
> if
> supported
>
> Both solutions work fine, with no barrier or lock in the standard case.
>
> What's more, Q_GLOBAL_STATIC is in use *everywhere* throughout Qt. If it
> were
> broken, we'd have a lot more trouble than caching the home path.
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20131028/b5f42872/attachment.html>


More information about the Development mailing list