There is discussion of pthread cancellation points (http://man7.org/linux/man-pages/man3/pthread_cancel.3.html) on several question. In some cases the respondents say that c
... what are pthread cancellation points used for?
From man 7 pthreads:
Cancellation points
POSIX.1 specifies that certain functions must, and certain other functions may, be cancellation points.
More:
If a thread is cancelable, its cancelability type is deferred, and a cancellation request is pending for the thread, then the thread is canceled when it calls a function that is a cancellation point.
Referring the questions:
As a final note: Avoid cancellation of threads whereever possible, as it might lead to unexpected and unreproducable behaviour of a program. Try to always design a program to be able to gracefully shut it down by ending all threads without explicit calling pthread_cancel().