I would like to kill a function that runs to the end. It is important that this function is inside the C extension (terminated in Cython), and I would like this solution to work in a multi-threaded environment. Since it is wrapped in Cython, this thread may contain a GIL.
I have no control over what is going on inside this extension (and I think this code will not respond to interrupts).
I am sure that this code will only work on Unix machines. But the question The Python freeze function is not applied, because I think that the signals will not work in a multi-threaded environment (AFAIK is undefined, which thread will catch them) --- but I can be wrong about that :) so correct me.
Is there any way to resolve this without the advent of new processes.
source share