Hands-On High Performance Programming with Qt 5 by Marek Krajewski

Hands-On High Performance Programming with Qt 5 by Marek Krajewski

Author:Marek Krajewski
Language: eng
Format: epub, mobi
Publisher: Packt Publishing
Published: 2019-01-30T15:26:41+00:00


Summary

In this chapter, we covered a lot of stuff, but concurrency is one of most important and, sadly, one of the most difficult and error-prone topics in programming.

We started with the basics, namely with what threads, mutexes, and atomics are. Then we learned the unfortunate fact that the use of mutexes can lead to several problems such as: deadlocks, livelocks, starvation, priority inversion, convoying, and false sharing. Fortunately, these problems can be avoided with some care. We then progressed to evaluating the performance costs of using threads and mutexes and of their alternative, namely lock-free data structures. In the next section, we learned what thread support classes Qt provides and how they integrate with its signal-slot mechanism. After that, we proceeded to multithreading optimization techniques—first, we learned how to decrease thread construction and context-switching costs and then how to decrease synchronization costs by the clever usage (or absence) of locking.

With this chapter, we have finished the first part of this book, which was intended to give the reader an overview of the generic performance principles as applied to the Qt framework.

In the next chapter, we will tell some stories about performance fails seen in the wild in order to illustrate and corroborate the general performance principles we have learned in the first chapters. After that, we will at last delve into a performance evaluation of the most important Qt modules.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.