O'Reilly logo

Hands-On System Programming with Linux by Kaiwan N Billimoria

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

In this chapter, we covered several safety aspects of working with threads that the powerful pthreads framework provides. We looked at thread-safe APIs, what they are, why they are required, and how to make a thread routine thread-safe. We also learned how to have one thread cancel (effectively, kill off) a given thread, and how to have the victim thread deal with any required cleanup. 

The remainder of the chapter focused on how to safely mix threads with the signaling interfaces; we also compared and contrasted – giving pros and cons (some food for thought, really)—the typical multiprocess single-threaded with several processes versus multithreaded (with one process) approaches. Tips and FAQs round off this trilogy of chapters ( ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required