Having covered, in Chapters 14, Multithreading with Pthreads Part I - Essentials, and Chapter 15, Multithreading with Pthreads Part II - Synchronization, a lot of the whys and hows of writing powerful multithreaded (MT) applications, this chapter focuses on teaching the reader several key safety aspects of MT programming.
It sheds some light on many key safety aspects of developing safe and robust MT applications; here, the reader will learn about thread safety, why it is required, and how to make a function thread-safe. While running, it's possible to have one thread kill another thread; this is achieved via the thread-cancelation mechanism—going hand in hand with cancelation, how does one ensure that prior to terminating a thread, one ensures that it first releases any resources it is still holding (such as locks and dynamic...