In Understanding The Linux Kernel:
Unix signals provide a mechanism for notifying processes of system events. Each event has its own signal number, which is usually referred to by a symbolic constant such as SIGTERM. There are two kinds of system events:
Asynchronous notifications For instance, a user can send the interrupt signal SIGINT to a foreground process by pressing the interrupt keycode (usually Ctrl-C) at the terminal.
Synchronous notifications For instance, the kernel sends the signal SIGSEGV to a process when it accesses a memory location at an invalid address.
and
... In general, a process may react to a signal delivery in two possible ways:
• Ignore the signal.
• Asynchronously execute a specified procedure (the signal handler).
I was wondering what asynchronous and synchronous mean
- in notifying processes of system events, and
- in process reacting to a signal delivery?
Thanks.
bash
internals.bash
seems to process signals specially (seetrap
) therefore I think the signal handler is called immediately like any program but the effects of the signal (shell-wise) is delayed after the current command has finished. – xhienne Aug 18 '17 at 09:04