# Summary ch3

1. **Process Concept:** &#x20;

   (1)The program code, also called **text section** &#x20;

   (2)Current activity context including **program counter**, processor registers &#x20;

   (3)**Stack** containing temporary data &#x20;

   (4)**Data section** containing global variables &#x20;

   (5)**Heap** containing memory dynamically allocated during run time &#x20;
2. **Process state:** &#x20;

   (1)**new**: The process is being created &#x20;

   (2)**running**: Instructions are being executed  &#x20;

   (3)**waiting**:  The process is waiting for some event to occur  &#x20;

   (4)**ready**:  The process is waiting to be assigned to a processor &#x20;

   (5)**terminated**:  The process has finished execution
3. **Process Control Block (PCB):** &#x20;

   (1)Each process is represented by a PCB &#x20;

   (2)Created and managed by the operating system &#x20;

   (3)Contains the process elements &#x20;
4. **When to switch process:** &#x20;

   (1)Clock interrupt &#x20;

   (2)I/O interrupt &#x20;

   (3)Memory fault &#x20;

   (4)Trap &#x20;

   (5)System call
5. **Context switch:** When CPU switches to another process, the system must save the state of the old process and load the saved state for the new process via a context switch
6. **interprocess communication (IPC)** &#x20;

   (1)Shared memory &#x20;

   (2)Message passing


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://liuyang89116.gitbook.io/operating-system/summary_ch3.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
