On Sunday 16 November 2014 19:02:19 René J.V. Bertin wrote: > On Sunday November 16 2014 18:47:34 Giuseppe D'Angelo wrote: > > Most of the value classes are implicitly shared: > > > > http://qt-project.org/doc/qt-5/implicit-sharing.html > > Yes, I saw that doc (also in Qt4). What kind of sharing does this refer to - > across threads and/or only across owners in a same thread? ObjC's reference > counting basically determines the lifetime of an object (and prevents the > need for a "deleteLater" operator).
QSharedPointer? > But the main thing I'm curious about: > is this implicit sharing mechanism thread safe and if so, do you (thus) use > some kind of interlocked increment/decrement of the reference counter? An atomic integer is used. See for e.g. QVector which uses QArrayData which in turn uses QtPrivate::RefCount which in turn uses QBasicAtomicInt. Cheers, Sean -- Dr Sean Harmer | sean.har...@kdab.com | Managing Director UK Klarälvdalens Datakonsult AB, a KDAB Group company Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322) KDAB - Qt Experts - Platform-independent software solutions _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest