-
哲学家进餐问题是荷兰学者Dijkstra 提出的经典问题之一,它是一个信号量机制问题的应用,在操作系统文化史上具有非常重要的地位。对该问题的剖析有助于学生深刻地...
哲学家进餐问题是荷兰学者Dijkstra 提出的经典问题之一,它是一个信号量机制问题的应用,在操作系统文化史上具有非常重要的地位。对该问题的剖析有助于学生深刻地理解计算机系统中的资源共享、进程同步、死锁等问题,并能熟练地应用信号量来解决生活中的控制流程,即将生活中的控制流程用形式化的方式表达出来。
假设有5个哲学家,他们花费一生中的时光思考和吃饭。这些哲学家共用一个圆桌,每个哲学家都有一把椅子。在桌子中央是一碗通心面,在桌子上放着5只筷子。(如图所示)当一个哲学家思考时,他与其他同事不交互。时而,哲学家会感到饥饿,并试图拿起与他相近的两只筷子(他与邻近左、右之间的筷子)。一个哲学家一次只能拿起一只筷子。显然,他不能从其他哲学家手里拿走筷子。当一个饥饿的哲学家同时有两只筷子时,他就不能不用释放他的筷子而自己吃了。当吃完后,他会放下两只筷子,并再次开始思考。
规定奇数号哲学家先拿他左边的筷子,然后再去拿右边的筷子;而偶数号哲学家则相反。按此规定,将是1、 2号哲学家竞争1号筷子;3、4号哲学家竞争3号筷子。即五位哲学家都先竞争奇数号筷子,获得后,再去竞争偶数号筷子,最后总会有一位哲学家能获得两只筷子而进餐。
-dining philosophers problem is the Netherlands scholars Dijkstra"s one of the classic, It is a signal to the mechanism of application, the operating system in the history of culture has a very important position. Analysis of the problem to help students understand deeply the computer system resource sharing, process synchronization, and other issues Deadlock, skilled and can be applied to solve the signal volume life of the control flow, about the life of the control flow w
- 2022-02-12 04:28:55下载
- 积分:1
-
样式表 样式表 样式表 样式表
样式表 样式表 样式表 样式表-Stylesheet style sheet style sheet style sheet style sheet style sheet style sheet
- 2022-03-19 23:54:44下载
- 积分:1
-
Android 开发指南中文版
本文是对Android SDK1.5版的英文开发资料Android Development Guide一文应用程序框架部分的...
Android 开发指南中文版
本文是对Android SDK1.5版的英文开发资料Android Development Guide一文应用程序框架部分的翻译,覆盖了Android应用开发所有主要的概念。部分内容整理自网络。本文仅用于技术学习,请勿用于商业用途。-version of this article is the English version of the Android SDK1.5 information on Android Development Guide developed an application framework part of the text of the translation, covering all the major Android application development concepts. Part of the content of the discussion from the network. This article is only for technological learning, do not for commercial purposes.
- 2023-09-01 08:20:04下载
- 积分:1
-
Zhou Aimin idea of software engineering work
周爱民的软件工程思想著作--大道至简,看了收获不少。-Zhou Aimin idea of software engineering work- Road to Jane, saw a lot of harvest.
- 2022-01-31 07:58:54下载
- 积分:1
-
rose做的一种模板文件,可以用他来学习rose,对初学者很有用。...
rose做的一种模板文件,可以用他来学习rose,对初学者很有用。-rose to do a template files, you can use him to study rose, very useful for beginners.
- 2022-03-12 17:30:40下载
- 积分:1
-
rising free r ising fr
rising free r ising fr
- 2022-03-17 00:59:15下载
- 积分:1
-
this software loader opentel ods4000v
this software loader opentel ods4000v
- 2022-09-24 08:45:03下载
- 积分:1
-
Hospital Management System Database Design
医院管理系统数据库设计-Hospital Management System Database Design
- 2023-08-21 07:05:04下载
- 积分:1
-
the high level architecture under development to members of the Federation of so...
在高层体系结构下对开发的联邦成员软件的一致性测试的软件方法-the high level architecture under development to members of the Federation of software conformance testing software methods
- 2023-01-14 00:55:04下载
- 积分:1
-
perl 自学文件 轻松自学24小时 pdf文件包分24章节详细介绍
perl 自学文件 轻松自学24小时 pdf文件包分24章节详细介绍-easily self-perl file pdf file 24-hour self-learning package minutes and 24 chapters detail
- 2022-01-31 04:22:59下载
- 积分:1