1

I am writing a Python C extension that contains multiple C pthreads. Eventually these threads are sent a SIGTERM in order for them to exit. When I step through the extension in GDB these threads exit successfully, and I return back to the Python interpreter where I can continue to run commands. It is also working successfully in the Python interpreter.

However, when I try to run a Python file that contains similar behavior, the entire program terminates after the signal is sent to the child thread.

I am confused as to how the signal is propagating up from the threads to the program itself, any guidance is appreciated.

Dominic
  • 81
  • 4
  • This [link](https://docs.python.org/3.4/library/signal.html#signals-and-threads) makes me believe what I am asking to do is not possible. – Dominic Jan 24 '19 at 21:48
  • For anyone who finds this question, I was unable to solve it using the signal handle that already existed. I used a [self-pipe](http://man7.org/tlpi/code/online/book/altio/self_pipe.c.html) instead. This solved the issue that I had. – Dominic Jan 25 '19 at 22:04

0 Answers0