I use pthread_create to create several child threads. At a time, the main thread wants to kill all child threads or there will be segment falut. Which function should I use to finish that? I searched the answer from google and got function like pthread_kill. But I did not know which signal should I send to the child thread to kill them. My running environment is RHEL 5.4 and programming language is C.
Share
It is possible to "cancel" a thread using
pthread_cancel. However, this isn’t typically best practice though under extreme circumstances like a SEGFAULT it may be conisdered a reasonable approach.