-
哲学家进餐问题是荷兰学者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 wi
- 2022-03-25 04:58:02下载
- 积分:1
-
UCOS test code against science and technology based on the BE
UCOS测试代码基于零点科技BE-A7的板卡-UCOS test code against science and technology based on the BE-A7 board
- 2023-01-18 14:40:03下载
- 积分:1
-
Chination免费电子邮件系统的设计系统需求概要设计书范例及相应的国标说明...
Chination免费电子邮件系统的设计系统需求概要设计书范例及相应的国标说明-Chination free e-mail system design system requirements outline design document examples and the corresponding State Note subscript
- 2022-03-02 20:02:33下载
- 积分:1
-
软件工程课后习题精讲
软件工程课后习题精讲 -ruanjian
- 2022-07-04 04:53:58下载
- 积分:1
-
毕业设计管理系统数据字典 北邮 计算机软件工程作业
毕业设计管理系统数据字典 北邮 计算机软件工程作业-Graduate design management system data dictionary of computer software engineering, Beijing University of Posts and Telecommunications operations
- 2022-02-10 11:26:46下载
- 积分:1
-
编程之道,从不同的视角介绍编程的思想,放松的看看,很有收获。...
编程之道,从不同的视角介绍编程的思想,放松的看看,很有收获。-Programming of the Road, from different angles, introduced the idea of programming, relaxed look, it is harvested.
- 2022-03-22 03:09:53下载
- 积分:1
-
这是一个关于HIS的软件分析与设计,有用的朋友下载
这是一个关于HIS的软件分析与设计,有用的朋友下载-This is one of HIS software analysis and design, download useful friends
- 2023-02-21 15:30:04下载
- 积分:1
-
一个汇编的看门狗设计,内容比较详细的介绍了看门狗软件的编写注意。并且有详细的例程。...
一个汇编的看门狗设计,内容比较详细的介绍了看门狗软件的编写注意。并且有详细的例程。-a compilation of the watchdog design, content rather detailed account of a software watchdog prepared attention. And a detailed routines.
- 2022-12-13 13:50:03下载
- 积分:1
-
PT2240编程手册和数据表
PT2240 Programming manual and datasheet
- 2022-08-14 10:15:18下载
- 积分:1
-
数据仓库与数据挖掘,包括informatica调优要点,etl以及BO等展现工具的应用,比较系统全面...
数据仓库与数据挖掘,包括informatica调优要点,etl以及BO等展现工具的应用,比较系统全面-Data warehouse and data mining, including the informatica tuning points, etl, and BO display tools such as the application of systematic and comprehensive comparison
- 2022-05-30 00:28:56下载
- 积分:1