- 1、本文档共23页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
CS 333Introduction to Operating SystemsClass 5 – Classical IPC Problems.ppt
CS 333Introduction to Operating Systems Class 5 – Classical IPC Problems Jonathan Walpole Computer Science Portland State University Classical IPC problems Producer Consumer (bounded buffer) Dining philosophers Sleeping barber Readers and writers Producer consumer problem Also known as the bounded buffer problem Is this a valid solution? How about this? Does this solution work? Producer consumer problem What is the shared state in the last solution? Does it apply mutual exclusion? If so, how? Dining philosophers problem Five philosophers sit at a table One fork between each philosopher Why do they need to synchronize? How should they do it? Is this a valid solution? Working towards a solution … Working towards a solution … Picking up forks Putting down forks Dining philosophers Is the previous solution correct? What does it mean for it to be correct? Is there an easier way? The sleeping barber problem The sleeping barber problem Barber: While there are people waiting for a hair cut, put one in the barber chair, and cut their hair When done, move to the next customer Else go to sleep, until someone comes in Customer: If barber is asleep wake him up for a haircut If someone is getting a haircut wait for the barber to become free by sitting in a chair If all chairs are all full, leave the barbershop Designing a solution How will we model the barber and customers? What state variables do we need? .. and which ones are shared? …. and how will we protect them? How will the barber sleep? How will the barber wake up? How will customers wait? What problems do we need to look out for? Is this a good solution? The readers and writers problem Multiple readers and writers want to access a database (each one is a thread) Multiple readers can proceed concurrently Writers must synchronize with readers and other writers only one writer at a time ! when someone is writing, there must be no readers ! Goals: Maximize concurrency. Prevent starvation. Designing a
您可能关注的文档
- 9-TCP讲义20111114.pdf
- 9各单元知识要点.doc
- @所有广州人:今年冬天不用打飞机去东北看雪!广州家门口就能看.pdf
- A Mathematical Model for Tone Apperception — Draft of a presentation at the AMS Sectional.pdf
- ADIS16260BCCZ;ADIS16265BCCZ;ADIS16265PCBZ;ADIS16260PCBZ;中文规格书,Datasheet资料.pdf
- AMD 编码识别.doc
- AN-8012-10-P030-电压力锅电源模块_12V-250mA_要点说明-20101120.pdf
- BehaviorofMgO_Al_省略_gRefiningProcess_Ken.pdf
- bf-edsty金融会计期末复习题-2011-stu.doc
- c ○ World Scientific Publishing Company GEOMETRICAL CONSTRAINT SYSTEM DECOMPOSITION A MULT.pdf
本人在医药行业摸爬滚打10年,做过实验室QC,仪器公司售后技术支持工程师,擅长解答实验室仪器问题,现为一家制药企业仪器管理。
文档评论(0)