As usual, here are some questions to test and maybe deepen your understanding of the material in this chapter.
- Why is a data race an undefined behavior (UB) in C++?
- What does resource acquisition is initialization (RAII) mean? (we have seen it already in Chapter 3, Deep Dive into C++ and Performance) and how it can be used in QAtomicLocker?
- Why can volatile variables not be used to prevent race conditions?
- What are spurious wakes and why aren't they banned?
- Assume you are an OS (or some tool) and have just detected a deadlock. What could you do to resolve it?
- What is cache ping-pong?
- If you define slots in a QThread subclass, what do you think will happen when they get invoked by a signal?
- What do you think, the Windows system call InitializeCriticalSectionAndSpinCount() could do?
- What do you understand about using QProcess instead of QThread?
- What does the phrase...