# 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;
