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 <[email protected] > 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 > [email protected] > http://lists.qt-project.org/mailman/listinfo/development > >
_______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
