登录
首页 » Java » philosopher(1.6)

philosopher(1.6)

于 2008-05-20 发布 文件大小:6KB
0 225
下载积分: 1 下载次数: 34

代码说明:

  哲学家进餐问题——Java语言实现 哲学家进餐问题是一个多线程运用的经典例子,涉及到线程同步/互斥,临界区访问问题以及一个避免死锁的解决方法。 有五个哲学家绕着圆桌坐,每个哲学家面前有一盘面,两人之间有一支筷子,这样每个哲学家左右各有一支筷子。 哲学家有2个状态,思考或者拿起筷子吃饭。如果哲学家拿到一只筷子,不能吃饭,直到拿到2只才能吃饭,并且一次只能拿起身边的一支筷子。一旦拿起便不会放下筷子直到把饭吃完,此时才把这双筷子放回原处。 如果,很不幸地,每个哲学家拿起他或她左边的筷子,那么就没有人可以吃到饭了。这就会造成死锁了。。这是需要坚决杜绝的,正如操作系统的死锁问题。()

文件列表:

philosopher
...........\.classpath
...........\.project
...........\DiningPhils.class
...........\DiningPhils.java
...........\Philosopher.class

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • java-Exe5_1
    1. 分别使用Vector、Hashtable、Stack,ArrayList、LinkedList和HashSet作为容器类,实现以下要求: (1) 向容器中添加1,000,000个随机整数。 (2) 遍历容器中的所有元素。 (3) 随机产生100,000个整数,在容器中查找这些整数。 (4) 随机产生100个整数,从容器中删除这些整数。 (5) 统计完成以上各个操作需要的时间。 比较一下不同操作在不同数据结构下的性能差异。程序文件命名为Exe5_1.java。 (51 respectively using Vector, Hashtable, Stack, ArrayList, LinkedList and HashSet as the container class, to achieve the following requirements: ( 1) are added to the container 1000000 random integers. ( 2) to traverse all the elements in the container. ( 3) 100000 randomly generated integer, in the container to find these integers. ( 4) random produces 100 integers, is removed from the container of these integers. ( 5) complete the statistics above each operation requires time. Compare the different operating at different data structure performance differences. Program file named Exe5_1.java )
    2012-12-14 11:26:23下载
    积分:1
  • 1-JSP+JDBC_virture_cutPage
    说明:  JSP假分页技术,内含详细代码以及学习笔记,相信对你的学习有所帮助!(JSP false paging technology, includes detailed code as well as the study notes, I believe that learning to your help!)
    2008-10-04 10:59:57下载
    积分:1
  • ADD
    自己用java写的计算器 自己用java写的计算器 自己用java写的计算器 自己用java写的计算器(Their own written in java calculator written in java calculator written in java calculator their own written in java calculator)
    2013-07-17 19:07:39下载
    积分:1
  • chat_aplli204118152007
    simple chat application in java
    2014-09-19 16:32:31下载
    积分:1
  • Regular-expressions-simplifypattern-matching-code
    Text processing often involves matching text against a pattern. Although Java s character and assorted string classes offerlow- levelpattern- matching support, that support commonly leads to complex code. To help you write simplerpattern- matching code, Java provides regular expressions. After introducing you to terminology and thejava.util. regex package, Jeff Friesen explores many regular expression constructs supported by that package s Pattern class. Then he examines Pattern s methods and the additionaljava.util. regex classes. In conclusion, he presents a practical application of regular expressions.(Text processing often involves matching text against a pattern. Although Java s character and assorted string classes offerlow-levelpattern-matching support, that support commonly leads to complex code. To help you write simplerpattern-matching code, Java provides regular expressions. After introducing you to terminology and thejava.util. regex package, Jeff Friesen explores many regular expression constructs supported by that package s Pattern class. Then he examines Pattern s methods and the additionaljava.util. regex classes. In conclusion, he presents a practical application of regular expressions.)
    2007-05-10 19:54:00下载
    积分:1
  • threadmanegaer
    多线程管理系统,可用于售票服务和排队服务的优先级等等,java实现(multithreading management system can be used for ticketing services and the priority queue levels, and so on, to achieve java)
    2007-05-27 15:21:32下载
    积分:1
  • Calculator0.9
    自己学习过程中做的计算器,还在修改,只实现了基本的算数功能,并且可能还存在BUG(The calculator that i do in the course of my study is still changing)
    2017-12-18 23:13:27下载
    积分:1
  • java
    一些java高级源代码,挺实用的,对初学者应该有帮助(High number of java source code, very useful, there should be help for beginners)
    2009-04-21 13:06:43下载
    积分:1
  • Ejercicio-5
    EJERICIO 5 SSD3, con buena calificacion,
    2014-04-23 07:32:42下载
    积分:1
  • SmsService
    1. SMSService.exe 短消息服务程序 2. SMS.ini 服务配置文件 3. SMS_DB.mdb 数据库接口文件 4. SmsClient.exe 短消息客户演示程序。">
    2013-07-27 16:01:17下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载