Skip to content
Snippets Groups Projects
Commit 9c2ebc58 authored by Ziheng Chen's avatar Ziheng Chen
Browse files

Edit questions.md

parent f0f3da7a
Branches
No related tags found
No related merge requests found
...@@ -45,10 +45,20 @@ ...@@ -45,10 +45,20 @@
- What is the purpose of signals in a Linux system, and how do they differ from other forms of interprocess communication (IPC)? - What is the purpose of signals in a Linux system, and how do they differ from other forms of interprocess communication (IPC)?
> **Answer**: _start here_ > **Answer**: _start here_
> 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? - Find and describe three commonly used signals (e.g., SIGKILL, SIGTERM, SIGINT). What are their typical use cases?
> **Answer**: _start here_ > **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).
- What happens when a process receives SIGSTOP? Can it be caught or ignored like SIGINT? Why or why not? - What happens when a process receives SIGSTOP? Can it be caught or ignored like SIGINT? Why or why not?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment