> Signals provide a way for processes to receive asynchronous notifications about events, such as termination requests (`SIGTERM`) or user interrupts (`SIGINT`). Unlike other IPC mechanisms (pipes, message queues, shared memory), signals do not carry data—they simply notify a process of an event. Signals are often used for handling process control (e.g., stopping or restarting services).
> - **`SIGKILL (9)`**: Immediately terminates a process and cannot be caught or ignored. Used when a process needs to be forcefully stopped (e.g., `kill -9 <pid>`).
> - **`SIGTERM (15)`**: Politely asks a process to terminate, allowing it to clean up resources. This is the preferred way to stop processes (e.g., `kill <pid>`).
> - **`SIGINT (2)`**: Sent when the user presses `Ctrl+C`. It allows a process to handle interruption gracefully, such as stopping an interactive program.
- Find and describe three commonly used signals (e.g., SIGKILL, SIGTERM, SIGINT). What are their typical use cases?
> **Answer**: _start here_
>
> When a process receives `SIGSTOP`, it is immediately paused (suspended) by the kernel. Unlike `SIGINT`, `SIGSTOP` **cannot** be caught, ignored, or blocked because it is intended for immediate process suspension. This makes it useful for debugging (e.g., using `kill -STOP <pid>` to pause a process).
> - **`SIGKILL (9)`**: Immediately terminates a process and cannot be caught or ignored. Used when a process needs to be forcefully stopped (e.g., `kill -9 <pid>`).
> - **`SIGINT (2)`**: Sent when the user presses `Ctrl+C`. It allows a process to handle interruption gracefully, such as stopping an interactive program.
> - **`SIGTERM (15)`**: Politely asks a process to terminate, allowing it to clean up resources. This is the preferred way to stop processes (e.g., `kill <pid>`).
- What happens when a process receives SIGSTOP? Can it be caught or ignored like SIGINT? Why or why not?
> **Answer**: _start here_
\ No newline at end of file
> **Answer**: _start here_
> When a process receives `SIGSTOP`, it is immediately paused (suspended) by the kernel. Unlike `SIGINT`, `SIGSTOP` **cannot** be caught, ignored, or blocked because it is intended for immediate process suspension. This makes it useful for debugging (e.g., using `kill -STOP <pid>` to pause a process).