-
哲学家进餐问题是荷兰学者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
-
这个文件来自地球
This file came from Planet-Source-Code.com...the home millions of lines of source code
You can view comments on this code/and or vote on it at: http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=58860&lngWId=1
The author may have retained certain copyrights to this code...please observe their request and the law by reviewing all copyright conditions at the above URL.-This file came from Planet-Source-Code.c om ... the home millions of lines of source code Y ou can view comments on this code/and or vote on i t at : http :// www.Planet-Source-Code.com/vb/scripts/ ShowCode.asp txtCodeId = 58860
- 2022-03-12 22:49:43下载
- 积分:1
-
我看Buddy(伙伴)算法-到底是怎么"找朋友"的
在《浅析armlinux...
我看Buddy(伙伴)算法-到底是怎么"找朋友"的
在《浅析armlinux-paging_init()->free_area_init_core()函数5-4》-I think Buddy (Partner) algorithm- in the end how the " Find friends" in the " Analysis of armlinux-paging_init ()-> free_area_init_core () function, 5-4"
- 2022-03-25 07:40:24下载
- 积分:1
-
本篇文档中包含了在LINUX环境下的触摸屏的源代码
本篇文档中包含了在LINUX环境下的触摸屏的源代码
-This document contains in the LINUX environment touch-screen source code
- 2022-03-14 09:58:30下载
- 积分:1
-
这是博弈论算法全集第四部分:剪枝算法,其它算法将陆续推出.以便与大家共享...
这是博弈论算法全集第四部分:剪枝算法,其它算法将陆续推出.以便与大家共享-This is game theory algorithms Works Part IV: pruning algorithm, other algorithms will be introduced. In order to share with everyone
- 2023-01-08 05:05:03下载
- 积分:1
-
用Multi
用Multi-Agent平台Zeus开发的一个功能完整的开源安全股票交易系统-with Multi-Agent Zeus platform for the development of a functional integrity of the open-source security stock trading system
- 2022-06-27 04:54:34下载
- 积分:1
-
一个简练的软件项目管理软件project2002的教程
一个简练的软件项目管理软件project2002的教程-A simple software project management software tutorials project2002
- 2022-07-01 15:08:29下载
- 积分:1
-
用户注册
该代码用于VB中的注册界面,主要查询数据库该用户是否被注册,若已注册则提示重新输入用户名,若未注册则将其注册为新用户。
- 2023-06-09 06:35:03下载
- 积分:1
-
概要设计说明书
概要设计说明书-国家计算机标准和文件模板-Summary of design specifications- the National Computer Standards and documentation templates
- 2023-08-28 22:30:02下载
- 积分:1
-
程序教程,程 序教程,程序教程,
程序教程,程 序教程,程序教程,-Tutorial program, the program curriculum, procedures and guidance
- 2022-05-24 16:21:44下载
- 积分:1