操作系统概念英文课件

上传人:我*** 文档编号:146035310 上传时间:2020-09-25 格式:PPT 页数:85 大小:948.50KB
返回 下载 相关 举报
操作系统概念英文课件_第1页
第1页 / 共85页
操作系统概念英文课件_第2页
第2页 / 共85页
操作系统概念英文课件_第3页
第3页 / 共85页
操作系统概念英文课件_第4页
第4页 / 共85页
操作系统概念英文课件_第5页
第5页 / 共85页
点击查看更多>>
资源描述

《操作系统概念英文课件》由会员分享,可在线阅读,更多相关《操作系统概念英文课件(85页珍藏版)》请在金锄头文库上搜索。

1、Chapter 4 Threads,An Introduction to Chapter 5(five parts),Why the thread needed, the concept of threads (4.1 Overview) thread states ( Appendix 4.A ) Categories and implementation (mapping) of threads ( 4.2) In view of programmers, multithreaded programming APIthread Libraries (4.3),October 2012,2,

2、Operating System Concepts- Chapter4 Threads -,Operating-System Examples (4.5) Windows XP Linux Appendixes HyperThread (HT) (Appendix 4.C) Dual-core CPU (Appendix 4.D),An Introduction to Chapter 5 (cont.),October 2012,3,Operating System Concepts- Chapter4 Threads -,4.1.1Why thread needed As described

3、 in Chapter 3, the process is as the unit of resource allocation unit of CPU scheduling The costs of process management, such as costs of process creation, cancellation, process switch and process communication, are somewhat high, refer to Fig.3.4, and the concurrency (or multiprogramming degree) ma

4、y be limited. To reduce costs of process management and improve degrees of concurrency and parallelism, the thread is presented,4.1 Overview,October 2012,4,Operating System Concepts- Chapter4 Threads -,Fig.3.4 CPU Switch From Process to Process,Kernel mode,User mode,User mode,in running state,in rea

5、dy or waiting state,In thread-supporting OS, the process is as the unit of resource allocation, while the thread as the unit of CPU scheduling and the running entity on CPU. Merits less costs of thread context switching than that of process context switching improving concurrency and parallelism, le

6、ss possibility of being blocked /* 程序并行执行 在多处理器系统中,线程被内核独立调度并可在多个处理器上运行。因此,当一个进程中含有多个线程时,进程可分得多个CPU,实现程序并行执行,Why thread needed (cont.),October 2012,6,Operating System Concepts- Chapter4 Threads -,Web server program Pr multithreaded web server process more than one thread in the process each thread s

7、erves for a client access request, many clients can be served concurrently.,Example,October 2012,7,Operating System Concepts- Chapter4 Threads -,Benefits (P131) responsiveness resource sharing economy utilization of multiple-processor architectures Refer to Appendix 4.A for more details about thread

8、s,Why thread needed (cont.),October 2012,8,Operating System Concepts- Chapter4 Threads -,4.1 Overview,4.1.2 Basic concepts Definition of the thread a basic unit/entity of CPU utilization, that is, the basic unit /entity for CPU scheduling as a part of a process and can indecently runs on CPU A proce

9、ss may contain several threads. As a basic unit for CPU scheduling, a thread in a process shares with other threads that belongs to the same process its code section, data section and other resources resources are allocated to the process, and all threads in this process share these resources tread

10、= thread ID + program counter + a register set + stack refer to Fig.4.1 and the figure in the next slide,October 2012,9,Operating System Concepts- Chapter4 Threads -,Basic concepts (cont.),Traditional process, also named heavyweight process, has a single thread of control A thread is also called a l

11、ightweight process (LWP),线程内容,tID 程序计数器 堆栈 寄存器组 状态 子线程,进程内容,PID 地址空间 全局变量 打开文件 子进程 定时器 信号 信号量 记账信息,resource shared by all threads in the process,+,October 2012,10,Operating System Concepts- Chapter4 Threads -,Fig.4.1 Single and Multithreaded Processes,The threads can be identified as user threads, o

12、r user-level threads (ULT) kernel threads, or kernel-level threads (KLT) User Threads thread management (creating, scheduling,.) is conducted by the user-level threads library, or by programming environments (midewares) OS may be still process-based Three primary thread libraries POSIX Pthreads Win3

13、2 threads Java threads,4.2 Multithreading Models,October 2012,12,Operating System Concepts- Chapter4 Threads -,Kernel threads supported by the kernel, OS is responsible for thread management Examples Windows XP/2000 Solaris Linux? Tru64 UNIX Mac OS X,In some systems, there exists KLT and ULT simulta

14、neously.,Multithreading Models (cont.),October 2012,13,Operating System Concepts- Chapter4 Threads -,In the system supporting kernel threads, OS scheduler assigns CPU to kernel threads. For the user-level threads, how to occupy the CPU ? How to implement ULTs by KLTs mapping between user threads and

15、 kernel threads,Multithreading Models (cont.),October 2012,14,Operating System Concepts- Chapter4 Threads -,Fig.5.0.3 Solaris 2 Threads,October 2012,15,Operating System Concepts- Chapter4 Threads -,u,L,线程库,k,u,线程 库,u,u,L,L,k,k,u,线程 库,u,u,L,L,k,k,u,L,k,u,L,线程库,k,u,线程调度程序,CPU,CPU,CPU,CPU,CPU,进程1,进程2,进

16、程4,进程5,硬 件,内核空间,用户空间,u,L,线程库,k,u,进程3,L,k,例。 Window XP + Java Run-time System,October 2012,16,Operating System Concepts- Chapter4 Threads -,4.2.1 Many-to-One Many user-level threads mapped to single kernel thread/process. refer to Fig.4.2 e.g. GNU Portable Threads, Green threads for Solaris2 Demerit blocking of one thread in a process results in the wh

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > PPT模板库 > PPT素材/模板

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号