Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does signal handler return back to?

Tags:

c

linux

Say that a process is running within the main method when a signal is received and handled. When the signal handler is finished, does the process return back to the line in main where the signal was received, or does it return to the signal call?

P.S. I know I can test this quickly myself but this thought occurred to me while I am without access to my PC.

Thanks.

like image 658
Lance_P Avatar asked Feb 08 '23 02:02

Lance_P


1 Answers

It returns back to where it was in your code when the signal was triggered.

Many libraries and applications exploit the same mechanisms to implement threadless multitasking (for instance libmill).

like image 113
Alfred Rossi Avatar answered Feb 11 '23 00:02

Alfred Rossi