0

Does SIGKILL get called on a unix thread when it terminates?

I'm monitoring an application which might be using a threadpool and registering a SIGKILL handler with a printf shows nothing. I'm trying to understand if there's a threadpool involved or not (if there is, the threads are never terminated and it makes sense not to read any output at all).

Dean
  • 6,610
  • 6
  • 40
  • 90
  • 1
    *registering a `SIGKILL` handler* `SIGKILL`? As in `-9`? You're wasting your time - [you can't catch `SIGKILL`.](https://stackoverflow.com/questions/35569659/the-signals-sigkill-and-sigstop-cannot-be-caught-blocked-or-orignored-why) – Andrew Henle Jun 19 '18 at 09:58

1 Answers1

0

Does SIGKILL get called on a unix thread when it terminates?

Nope.

One can send SIGKILL to a thread but well-behaved application do not and should not do that. The threads had better terminate in a cooperative fashion when they are told to by leaving the thread function or calling pthread_exit.

... registering a SIGKILL handler with a printf shows nothing

SIGKILL cannot be blocked or caught.

Maxim Egorushkin
  • 131,725
  • 17
  • 180
  • 271