Module5: Threads线程 Overview 综述 ● Benefits 益处 User and Kernel threads 用户和内核线程 Multithreading Models 多线程模型 Solaris 2 Threads Solaris2线程 Java threads Java线程 Applied Operating System Concepts 5.1
5.1 Applied Operating System Concepts Module 5: Threads线程 • Overview 综述 • Benefits 益处 • User and Kernel Threads 用户和内核线程 • Multithreading Models 多线程模型 • Solaris 2 Threads Solaris 2线程 • Java Threads Java线程
Benefits益处 Responsiveness 响应 ° Resource Sharing 资源共享 Economy 经济性 Utilization of MP Architectures MP体系结构的运用 Applied Operating System Concepts 2
5.2 Applied Operating System Concepts • Responsiveness 响应 • Resource Sharing 资源共享 • Economy 经济性 • Utilization of MP Architectures MP体系结构的运用 Benefits益处
Single and Multithreaded Processes 个和多线 Code Data Files Code Data Files Thread 33 Thread Single-threaded Multi-threaded Applied Operating System Concepts 5.3
5.3 Applied Operating System Concepts Single and Multithreaded Processes 单个和多线程进程
User Threads Thread Management Done by User-Level Threads Library 由用户级线程库进行管理的线程 Examples例子 POSIX Pthreads Mach C-threads Solaris threads Applied Operating System Concepts 5.4
5.4 Applied Operating System Concepts User Threads 用户线程 • Thread Management Done by User-Level Threads Library 由用户级线程库进行管理的线程 • Examples例子 - POSIX Pthreads - Mach C-threads - Solaris threads
Kernel threads 内核线程 Supported by the Kernel 由内核支持 Examples例子 Windows 95/98/NT Solaris Digital UNIX Applied Operating System Concepts 5
5.5 Applied Operating System Concepts Kernel Threads 内核线程 • Supported by the Kernel 由内核支持 • Examples例子 - Windows 95/98/NT - Solaris - Digital UNIX
Multithreading Models 多线程模型 °Many-to-One 多对 One-to-One 对 °Many-to-Many 多对多 Applied Operating System Concepts 5.6
5.6 Applied Operating System Concepts Multithreading Models 多线程模型 • Many-to-One 多对一 • One-to-One 一对一 • Many-to-Many 多对多
Many-to-One多对 Many User-Level Threads Mapped to Single Kernel Thread 多个用户级线程映像进单个内核线程 Used on Systems That Do Not Support Kernel Threads 用于不支持内核线程的系统中1 Applied Operating System Concepts 7
5.7 Applied Operating System Concepts Many-to-One多对一 • Many User-Level Threads Mapped to Single Kernel Thread. 多个用户级线程映像进单个内核线程 • Used on Systems That Do Not Support Kernel Threads. 用于不支持内核线程的系统中
Many- to-one Model多对一模型 user thread k kernel thread Applied Operating System Concepts 5.8
5.8 Applied Operating System Concepts Many-to-one Model多对一模型
One-to-One一对 Each User-Level Thread Maps to Kernel Thread 每个用户级线程映像进内核线程 Examples Windows 95/98/NT /e: OS/2 Applied Operating System Concepts 5.9
5.9 Applied Operating System Concepts One-to-One一对一 • Each User-Level Thread Maps to Kernel Thread. 每个用户级线程映像进内核线程 • Examples - Windows 95/98/NT - OS/2
One-to- one Model-对一模型 3333←-m k kernel thread Applied Operating System Concepts 5.10
5.10 Applied Operating System Concepts One-to-one Model一对一模型