Thread cancelation and cleanup

The pthreads design provides a sophisticated framework for achieving two other key activities for a robust multithreaded application: the ability to have a thread in the app cancel (effectively, kill) another thread, and the ability to have a thread that is either terminated normally (via the pthread_exit(3)) or abnormally (via cancelation) be able to perform the required resource cleanup.

The following sections deal with these topics.

Get Hands-On System Programming with Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.