# Summary ch4

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

   (1)A virtual address space which holds the process image &#x20;

   (2)Protected access to processors, other processes
2. **Multithreading**:To support multiple, concurrent paths of execution within a single process

   **Advantages:** &#x20;

   (1)Information sharing &#x20;

   (2)Modular program structure &#x20;

   (3)Speed of execution &#x20;

   (4)Convenience
3. **Benefits of threads:** &#x20;

   (1)Takes less time to create a new thread than a process &#x20;

   (2)Less time to terminate a thread than a process  &#x20;

   (3)Less time to switch between two threads within the same process &#x20;
4. **User-Level threads:** &#x20;

   (1)Thread library entirely executed in user mode  &#x20;

   (2)Kernel is not involved!  &#x20;

   (3)Cheap to manage threads &#x20;

   (4)Cheap to do context switch &#x20;

   (5)A blocking system call blocks all peer threads &#x20;
5. **Kernel-Level threads:** &#x20;

   (1)Kernel is aware of and schedules threads &#x20;

   (2)A blocking system call, will not block all peer threads &#x20;

   (3)Kernel maintains context information for   the process and the threads &#x20;

   (4)Scheduling is done on a thread basis &#x20;
6. **User vs. Kernel-level threads:** &#x20;

   **User-level threads:** &#x20;

   (1)Cheap to manage and to do context switch &#x20;

   (2)A blocking system call blocks all peer threads &#x20;

   **Kernel-level threads:** &#x20;

   (1)A blocking system call will not block all peer threads &#x20;

   (2)Expensive to manage and to do context switch &#x20;
7. **LWP features:** &#x20;

   (1)Cheap thread management &#x20;

   (2)A blocking system call may not suspend the whole process &#x20;

   (3)LWPs are transparent to the application &#x20;

   (4)LWPs can be easily mapped to different CPUs &#x20;

   (5)Managing LWPs is expensive (like kernel threads)  &#x20;


---

# 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_ch4.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.
