January 2018
Intermediate to advanced
486 pages
11h 28m
English
Sometimes, in multithreaded programming, we need to make sure multiple threads can access a limited number of identical resources accordingly. For instance, a device that will be used to run a program might have a very limited amount of memory on it, so we would prefer that our threads that need an extensive amount of memory take this fact into account and act based on the available amount of memory. This and similar issues in multithreaded programming are usually taken care of by using semaphores. A semaphore is similar to an enhanced mutex, which is not only capable of locking and unlocking, but also keeping track of the number of available resources.
The Qt framework provides a class called QSemaphore (conveniently enough) to ...