January 2018
Intermediate to advanced
486 pages
11h 28m
English
As powerful as mutexes are, they lack certain capabilities, such as different types of locks. So, even though they are quite useful for access serialization, they cannot be effectively used for cases such as read-write serialization, which basically rely on two different types of locks: read and write. Let's again break this down with an example. Let's assume we want various threads to be able to read from an object (such as a variable, class instance, file, and so on) at the same time, but we want to make sure only one thread can modify (or write to) that object at any given time. For such cases, we can use the Read-Write Lock mechanisms, which are basically enhanced mutexes. The Qt framework provides the QReadWriteLock ...