- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
操作系统课件ch7
* * * * * * * * * * * * * * * * * * * * * * * 7-cont. 3. Show that, if the wait and signal operations are not executed atomically, then mutual exclusion may be violated. 4. The Sleeping-Barber Problem. A barbershop consists of a waiting room with n chairs and the barber room containing the barber chair. If there are no customers to be served, the barber goes to sleep. If a customer enters the barbershop and all chairs are occupied, then the customer leaves the shop. If the barber is busy but chairs are available, then the customer sits in one of the free chairs. If the barber is asleep, the customer wakes up the barber. Write a program to coordinate the barber and the customers. 5. The Cigarette-Smokers Problem. Consider a system with three smoker processes and one agent process. Each smoker continuously rolls a cigarette and then smokes it. But to roll and smoke a cigarette, the smoker needs three ingredients: tobacco, paper, and matches. One of the smoker processes has paper, another has tobacco, and the third has matches. The agent has an infinite supply of all three materials. The agent places two of the ingredients on the table. The smoker who has the remaining ingredient then makes and smokes a cigarette, signaling the agent on completion. The agent then puts out another two of the three ingredients, and the cycle repeats. Write a program to synchronize the agent and the smokers. 6.阅读分析Linux中进程、线程同步代码 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Deadlock and Starvation Deadlock(死锁) – two or more processes are waiting indefinitely for an event that can be caused by only one of the waiting processes. Let S and Q be two semaphores initialized to 1 P0 P1 wait(S); wait(Q); wait(Q); wait(S); ? ? signal(S); signal(Q); signal(Q) signal(S); Starvation(饿死) – indefinite blocking. A process may never be removed from the semaphore queue in which it is suspended. Two Types of Semaphores Counting semaphore(计数信号量) – integer value can range ove
您可能关注的文档
- 摄影学英文讲解 Photography.ppt
- 撒哈拉以南非洲上课.ppt
- 操作系统1-7章复习.ppt
- 摩拉产品介绍2014.pptx
- 操作系统_实验一.doc
- 操作培训MDS.ppt
- 撒切尔夫人超详细英文介绍.ppt
- 操作系统原理实验报告(最终版).doc
- 操作系统第四章1.ppt
- 操作系统课件CCH07-Process Synchronization.ppt
- 2025年反电信诈骗宣传工作总结(3篇).docx
- 2025下半年江苏省盐城市教育局直属学校第二批校园招聘具有硕士研究生及以上学历学位优秀青年人才17人备考笔试试题及答案解析.docx
- 2025江苏南通通州区十总镇残疾人之家招聘一般公益性岗位2人参考考试题库及答案解析.docx
- 2025年温州市国有资本投资运营有限公司招聘16人(第二批)参考笔试题库附答案解析.docx
- 医疗设备故障应急预案(3篇).docx
- 医院感染预防与控制知识考试题及答案资料(3篇).docx
- 2025阳泉平定县从社区专职网格员中选聘社区专职工作人员备考笔试试题及答案解析.docx
- 2025山西大同市消防救援支队面向社会招录政府专职消防员116人备考笔试题库及答案解析.docx
- 2025年公司审计年终工作总结(3篇).docx
- 2025年年甘肃省酒泉市体育运动学校招聘公益性岗位工作人员备考笔试题库及答案解析.docx
原创力文档


文档评论(0)