What is the signal processing workflow in python? I install a signal handler when a signal occurs, how does python call my function? Does the OS describe this as a C program? If I am in python C-sample, does it break immediately?
Now it’s clear to me how the python process is handled. When you set the signal with the signal module, the module registers the signal_handler function (see $ Src / Modules / signalmodule.c), which sets your handler and puts it as 1 ( Handlers[sig_num].tripped = 1;), and then calls Py_AddPendingCall to tell the python translator. The python interpreter will call Py_MakePendingCalls to call PyErr_CheckSignals, which calls your function in the main loop (see $ Src / Python / ceval.c). let me know if you want to talk about it: renenglish@gmail.com
Handlers[sig_num].tripped = 1;
Python , , . . , . C, , , C Python. , , .
, readline, , - . , readline ( C) , .
. python script, , , . . , SIGKILL, .