文件名称:thinking
介绍说明--下载内容来自于网络,使用问题请自行百度
根据哲学家进程间的相互制约关系,设置合理的信号量及信号量初值。
创建5个线程,分别模拟5个哲学家进程。
在哲学家线程之间通过对信号量的P,V操作,实现线程之间的同步关系。(According to the mutual restriction between the philosophers' process, the reasonable signal quantity and the initial value of the signal quantity are set up.
Create 5 threads to simulate the 5 philosopher processes, respectively.
The synchronization relationship between threads is realized between the philosophers' threads through the P and V operations of the semaphore.)
创建5个线程,分别模拟5个哲学家进程。
在哲学家线程之间通过对信号量的P,V操作,实现线程之间的同步关系。(According to the mutual restriction between the philosophers' process, the reasonable signal quantity and the initial value of the signal quantity are set up.
Create 5 threads to simulate the 5 philosopher processes, respectively.
The synchronization relationship between threads is realized between the philosophers' threads through the P and V operations of the semaphore.)
相关搜索: 哲学家问题
(系统自动生成,下载前可以参看下载内容)
下载文件列表
文件名 | 大小 | 更新时间 |
---|---|---|
shiyan3.c | 4041 | 2017-11-28 |
thinking.c | 1508 | 2017-11-22 |
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.