计算机操作系统-ch2a精要
* The Thread Model (1) (a) Three processes each with one thread (b) One process with three threads * The Thread Model (2) Items shared by all threads in a process Items private to each thread * The Thread Model (3) Each thread has its own stack * Thread Usage Why do you use threads? Responsiveness: Multiple activities can be done at same time. They can speed up the application. Resource Sharing: Threads share the memory and the resources of the process to which they belong. Economy: They are easy to create and destroy. Utilization of MP (multiprocessor) Architectures: They are useful on multiple CPU systems. Example - Word Processor, Spreadsheet One thread interacts with the user. One formats the document (spreadsheet). One writes the file to disk periodically. Why not three processes? * Thread Usage (1) A word processor with three threads * Thread Usage(2) Example – Web server One thread, the dispatcher, distributes the requests to a worker thread. A worker thread handles the requests. * Thread Usage (2) A multithreaded Web server * Thread Usage (2) Rough outline of code for previous slide (a) Dispatcher thread (b) Worker thread * POSIX Threads Figure 2-14. Some of the Pthreads function calls. * POSIX Threads Figure 2-15. An example program using threads. * Implementation of Threads Three mechanism Implementing threads in user space Implementing threads in kernel space Hybrid Implementations * User Threads(ULT) The threads package entirely in user space, kernel doesn’t know thread Threads management done by user-level threads library Thread switch don’t need kernel privilege, user-level threads are fast to create and manage. Problem: If the kernel is single-threaded, then any user-level thread performing a blocking system call will cause the entire process to block. Examples of threads library - POSIX Pthreads - Mach C-threads - Solaris UI-threads * Implementing Threads in User Space A user-level threads package * Kernel Threads(KLT) Supported by the Kernel
您可能关注的文档
- 计算机控制系统PPT_3滤波控制策略基础与串级ok精要.ppt
- 外研版八年级下册语法讲解—完成时要点.doc
- 计算机控制系统--信号精要.ppt
- 外研版五年级下Iwenttherelastyear.要点.ppt
- 外研(新标准)版九年级上Module7GreatbooksUnit3Languageinuse(共41张PPT)要点.ppt
- 外研版高中英语必修2-M4要点.ppt
- 外研版九年级下册模块7Unit1要点.ppt
- 外研版英语必修三Module1EuropeGrammar课件(共76张PPT)要点.ppt
- 外研版英语七年级下语法总复习PPT课件要点.ppt
- 计算机操作员初级理论培训精要.doc
- 2026年及未来5年市场数据中国锡合金行业市场发展现状研究及投资战略咨询报告.docx
- 2026年及未来5年市场数据中国纤维板行业市场专项调研及投资前景可行性预测报告.docx
- 2026年及未来5年市场数据中国文化创意产业发展前景预测及投资分析报告(版).docx
- 加快完善内河集装箱转运体系 促进运河经济向海河经济转型.docx
- 知识产权保护策略及商业秘密保密协议2025年指南.docx
- 2026年及未来5年市场数据中国微型扬声器受话器市场产销调研及投资动向研究报告.docx
- 2026年及未来5年市场数据中国无机化工新材料市场前景研究与投资前景分析报告.docx
- 2026年及未来5年市场数据中国无线电计量器具市场运行格局及投资战略研究报告.docx
- 2026年及未来5年市场数据中国西洋参行业市场发展深度调查及投资战略可行性报告.docx
- 2026年及未来5年市场数据中国文化创意产业行业市场规模及投资前景预测分析报告.docx
最近下载
- 15万ta电池级硫酸锰新能源材料项目一期竣工环境保护验收监测报告书.pdf VIP
- 西工大航空发动机燃烧学讲义.pdf VIP
- 2025年工业机器人伺服电机性能优化研究报告.docx VIP
- 《深度学习 》课件 第9章-深度强化学习.pptx
- 有机高分子电致发光材料及器件课件.ppt VIP
- 贵州红星发展股份有限公司 高纯钡盐产业化项目 环境影响报告书.doc VIP
- (网络收集版)2025年新课标全国一卷数学高考真题文档版(无答案).pdf
- 2025年工业机器人伺服电机国内外市场对比研究报告.docx VIP
- 2025年无人机驾驶员执照飞行记录在物流运输专题试卷及解析.pdf VIP
- 河南卫生事业单位招聘考试题.pdf VIP
原创力文档

文档评论(0)