Hacker News new | past | comments | ask | show | jobs | submit login

> C++ stdlib collections not thread safe by default and cannot be used as drop-in replacements for Qt's collections.

I agree with other parts of your post, but not this. How is Qt's collections thread safe in any way? And won't that be a huge performance cost, since most of the time, collections do not need to be thread safe?




They are not (generally) thread safe. Quoting http://doc.qt.io/qt-4.8/threads-reentrancy.html

> Many Qt classes are reentrant, but they are not made thread-safe, because making them thread-safe would incur the extra overhead of repeatedly locking and unlocking a QMutex. ...

> Some Qt classes and functions are thread-safe. These are mainly the thread-related classes (e.g. QMutex) and fundamental functions (e.g. QCoreApplication::postEvent()).




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: