




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、4.2Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th edition, Jan 23, 2005nOverviewnMultithreading ModelsnThreading IssuesnPthreads4.3Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th edition, Jan 23, 2005nA thread is a basic unit of CPU utilization;lit comprises a thre
2、ad ID, a program counter, a register set,and a stack.lIt shares with other threads belonging to the same process: the code section, the data section, and other OS resources,such as open files, signals, etcnA traditional process has a single thread of control: lheavyweight process.4.4Silberschatz, Ga
3、lvin and Gagne 2005Operating System Concepts 7th edition, Jan 23, 20054.5Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th edition, Jan 23, 2005nOn modern desktop PC, many APPs are multithreaded.la seperate process with several threadslExample 1: A web browser4one for displaying image
4、s or text;4another for retrieving data from networklExample 2: A word processor4one for displaying graphics;4another for responding to keystrokes from the user;4and a third for performing spelling & grammer checking in the background4.6Silberschatz, Galvin and Gagne 2005Operating System Concepts
5、 7th edition, Jan 23, 2005nIn certain situations, a single application may be required to perform several similar tasks. Example: a web servernAllow a server to service several concurrent requests. Example: an RPC servernThe OS itself needs to perform some specific tasks in kernel, such as managing
6、devices or interrupt handling.lPARTICULAR, many OS systems are now multithreaded.lExample: Solaris, Linux4.7Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th edition, Jan 23, 2005nResponsivenesslExample: an interactive application such as web browser. while one thread loading an image
7、, another thread allowing user interactionnResource Sharinglmemory, and other resourcesnEconomy (e.g. save memory) lSolaris:creating a process is about 30 times slower then creating a thread;context switching is about 5 times slowernUtilization of MP Architectureslparallelism and concurrency 4.8Silb
8、erschatz, Galvin and Gagne 2005Operating System Concepts 7th edition, Jan 23, 2005nTwo methods to support threadslUser threads VS. Kernel threadsnUser ThreadslThread management done by user-level threads library without kernel supportnKernel threadslSupported by the Kernel, usually may be slower the
9、n user threadlExamples4Windows XP/20004Solaris4Linux4Tru64 UNIX4Mac OS X4.9Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th edition, Jan 23, 2005nThe relationship between user threads and kernel threadslMany-to-OnelOne-to-OnelMany-to-Many4.10Silberschatz, Galvin and Gagne 2005Operati
10、ng System Concepts 7th edition, Jan 23, 2005nMany user-level threads mapped to single kernel threadnExamples:lSolaris Green ThreadslGNU Portable Threads4.11Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th edition, Jan 23, 20054.12Silberschatz, Galvin and Gagne 2005Operating System Co
11、ncepts 7th edition, Jan 23, 2005nEach user-level thread maps to kernel threadnExampleslWindows NT/XP/2000lLinuxlSolaris 9 and later4.13Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th edition, Jan 23, 20054.14Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th edition, J
12、an 23, 2005nAllows many user level threads to be mapped to many kernel threadsnAllows the operating system to create a sufficient number of kernel threadsnSolaris prior to version 9nWindows NT/2000 with the ThreadFiber package4.15Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th editi
13、on, Jan 23, 20054.16Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th edition, Jan 23, 2005nSimilar to M:M, except that it allows a user thread to be bound to kernel threadnExampleslIRIXlHP-UXlTru64 UNIXlSolaris 8 and earlier4.17Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th edition, Jan 23, 20054.18Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th edition, Jan 23, 2005nA thread library provides an API for creating and managing threads.nTwo primary ways
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 环境分析与优势识别试题及答案
- 药物疗法与患者管理试题及答案
- 计算机基础知识的全方位学习试题及答案
- Module7 Unit2 This Little Girl Can't Walk(教学设计)-2024-2025学年外研版(三起)英语五年级上册
- 2024福建晋园发展集团有限责任公司权属子公司招聘9人笔试参考题库附带答案详解
- 逻辑学模考试题与答案
- Unit 5 Fun Clubs Section A 1a-1d 教学设计 2024-2025学年人教版七年级英语上册
- 输血技师模拟考试题与参考答案
- 七年级生物上册 第二单元 生物体的结构层次第一章 细胞是生命活动的基本单位第四节 细胞的生活教学设计 (新版)新人教版
- 宠物营养动态评估方法试题及答案
- 心脏外科围手术期康复
- 《让子弹飞》电影赏析
- 2024年四川省绵阳市中考英语试题卷(标准含答案)
- 西方文论概览(第二版)-第五章课件
- 数列的概念(第一课时)教案高二数学(人教A版2019选择性必修第二册)
- 铲车司机雇佣合同范本
- 2024年广东省初中学业水平考试中考道法试卷(真题+答案解析)
- 江苏省南京市鼓楼区2023-2024学年五年级下学期期末检测语文试卷
- 2024年山东省济南市莱芜区中考一模数学试题(含答案解析) (二)
- 中国感染性休克指南
- 保洁清洁剂使用培训
评论
0/150
提交评论