January 2018
Intermediate to advanced
486 pages
11h 28m
English
Another common issue in multithreaded programming can occur because a certain thread must wait for some condition other than the thread being executed by the operating system. In such cases, if quite naturally, a mutex or a read-write lock is used by the thread, it can block all other threads because it is simply the thread's turn to run and it is waiting for some specific condition. One would expect that the thread that needs to wait for a condition, goes to sleep after it releases the mutex or read-write lock so that other threads continue to operate, and when the condition is met, it is woken up by another thread.
In the Qt framework, there is a class called QWaitCondition, which is dedicated to handling such issues we ...