- 1、本文档共109页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * The Critical Section Problem n processes all competing to use some shared data Each process has a code segment, called critical section (CS), in which the shared data is accessed. Problem – ensure that when one process is executing in its critical section, no other process is allowed to execute in its critical section Even with multiple CPUs Each process must request the permission to enter its CS The critical section problem is to design a protocol that the processes can use so that their action will not depend on the order in which their execution is interleaved (possibly on many processors) Semaphore, Monitor : provided by OS Test-and-Set instruction : Hardware /wiki/Critical_section Semaphore Synchronization tool (provided by the OS) that does not require busy waiting Formally, a semaphore is comprised of: An integer variable: value Two atomic operations: P( ) and V( ) P( ) also known as wait( ) While value = 0, sleepDecrement value and return V( ) also known as signal( ) Increments valueIf there are any threads sleeping waiting for value to become non-zero, wakeup at least 1 thread /wiki/Semaphore_(programming) Java: notify( ) notifyAll( ) /wiki/Producers-consumers_problem Monitors A monitor is a set of programmer-defined operations that are provided mutual exclusion within the monitor (the monitor construct prohibits concurrent access to all procedures defined within the monitor) Type of condition: x.wait and x.signal Signal-and-Wait: P=wait Q to leave the monitor or another condition Signal-and-Continue: Q=wait P to leave the monitor or other condition P x.signal Q(suspended) associated with condition x resume Java uses Monitors for Mutual Exclusion: wait( ), notify( ), notifyAll( ) A Monitor is essentially a class with private methods, plus a queue. /wiki/Operating_System_Des
您可能关注的文档
- 2003年普通高中教材编写立项申报材料要求.DOC
- 2007国家精品课程申报表-武汉轻工大学.DOC
- 2005年浙江嘉兴高考4月月考模拟试卷.DOC
- 2009上海精品课程申报表-复旦大学精品课程.DOC
- 2008讲座别标本作制枚数.PPT
- 2009年国家级精品课程申报表-复旦大学精品课程.DOC
- 2009BALIS馆际互借中心工作总结-旧版管理系统.PPT
- 2011学开设辅修双专业双学位一览表-中山大学教务部.DOC
- 2010年北京大学出版社—山东高校美学艺术学教学研讨会.DOC
- 2011年百篇优秀管理案例.DOC
- [中央]2023年中国电子学会招聘应届生笔试历年参考题库附带答案详解.docx
- [吉安]2023年江西吉安市青原区总工会招聘协理员笔试历年参考题库附带答案详解.docx
- [中央]中华预防医学会科普信息部工作人员招聘笔试历年参考题库附带答案详解.docx
- [保定]河北保定市第二医院招聘工作人员49人笔试历年参考题库附带答案详解.docx
- [南通]江苏南通市崇川区人民法院招聘专职人民调解员10人笔试历年参考题库附带答案详解.docx
- [厦门]2023年福建厦门市机关事务管理局非在编工作人员招聘笔试历年参考题库附带答案详解.docx
- [三明]2023年福建三明市尤溪县招聘小学幼儿园新任教师79人笔试历年参考题库附带答案详解.docx
- [哈尔滨]2023年黑龙江哈尔滨市木兰县调配事业单位工作人员笔试历年参考题库附带答案详解.docx
- [上海]2023年上海市气象局所属事业单位招聘笔试历年参考题库附带答案详解.docx
- [台州]2023年浙江台州椒江区招聘中小学教师40人笔试历年参考题库附带答案详解.docx
文档评论(0)