They're awesome...and they're probably the most dangerous things in the whole Qt framework. They promise in documentation that it's usable in multi-threaded environement, when in fact they are _not_ usable there. Which renders using Qt in multi-threaded applications an adventure toward undefined behaviour.
Qt's implicitely shared classes are NOT thread safe. It's easy to write a program demonstrating this: http://www.folding-hyperspace.com/program_tip_15.htm
Given, it's wonderful approach for maybe 95% of applications. But I don't know how much time we wasted investigating for this before we finally discovered this flaw (and we discovered it by chance).
It's not only limited to Qt. Qt is just open source and documented quite openly. As I know, MFC, C# and some other languages alos use CoW (or implicit sharing) and you can't find any documentation or implementation details about them. This is not comforting.
Take this with a huge grain of salt. http://www.folding-hyperspace.com/program_tip_15.htm
They're awesome...and they're probably the most dangerous things in the whole Qt framework. They promise in documentation that it's usable in multi-threaded environement, when in fact they are _not_ usable there. Which renders using Qt in multi-threaded applications an adventure toward undefined behaviour. Qt's implicitely shared classes are NOT thread safe. It's easy to write a program demonstrating this: http://www.folding-hyperspace.com/program_tip_15.htm Given, it's wonderful approach for maybe 95% of applications. But I don't know how much time we wasted investigating for this before we finally discovered this flaw (and we discovered it by chance). It's not only limited to Qt. Qt is just open source and documented quite openly. As I know, MFC, C# and some other languages alos use CoW (or implicit sharing) and you can't find any documentation or implementation details about them. This is not comforting.