Commit Graph

4 Commits

Author SHA1 Message Date
Marco Bubke
5e0b207a89 Clang: Improve locking of string cache
The string cache is only very seldom written but very often read. To
improve thread scaling it is faster to lock it only for write operations.
So we use a shared mutex which is locked in shared mode for read
operations and locked exclusively for write operations.

Change-Id: I7dfd4a02c5484683e4d0becd39269c0146126a96
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-10-18 13:13:29 +00:00
Christian Stenger
9bd0fcbe2e Revert "Clang: Improve locking of string cache"
This reverts commit be939a80db.
'shared_timed_mutex' is not available before Xcode 9.

Change-Id: I1ac6c2b3691d5b4f457c431e255629a526c48c3a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-10-10 09:12:21 +00:00
Marco Bubke
be939a80db Clang: Improve locking of string cache
The string cache is only very seldom written but very often read. To
improve thread scaling it is faster to lock it only for write operations.
So we use a shared mutex which is locked in shared mode for read
operations and locked exclusively for write operations.

Change-Id: I2cc742d1b9cc15c162be40ab339fa8310640bc44
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-10-05 17:48:23 +00:00
Marco Bubke
623135592c Sqlite: Add locking for sqlite transactions
If you use the database in a multi-threaded environment, you must always
your statements in transactions.

For read-only statements, you use DeferredTransaction and write statements
you use ImmediateTransaction. If you mix read and write statements you have
to use ImmediateTransaction. Don't use DeferredTransaction because it leads
to undefined behavior.

Change-Id: Ida298a20f33423c8da09e768a7b658dd8e918f46
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-09-20 10:44:37 +00:00