http://www.math-cs.gordon.edu/courses/cs322/projects/p2/dp/
Solution of the Dining Philosophers Problem using Shared Memory and Semaphores
Two versions of this program are included. One is written in C and the other in CPP. Both make use of the pthreads library to start a new process that shares memory with it's parent. They both also use POSIX unnamed semaphores.
Both programs require several support files written in C:
msecond.c and msecond.h: Implements a function that returns the number of milliseconds (resolution is system dependent but is commonly 10 milliseconds) since it's first invocation.
random_int.c and random_int.h: Implements a function that returns a random integer from an exponetial distribution with a specified mean. There is also a function to initialize the random number generator. Used the standard library functions random() and srandom().
For the C version you need:
The source: philosopher.c.
The C version of the Makefile.
For the C++ version you need:
The source: philosopher.cc.
The C++ version of the Makefile.
Comments should be addressed to Jonathan R. Senning
$Revision: 1.1 $; File last modified: $Date: 2000/01/07 18:01:06 $ GMT
操作系统 哲学家就餐 C/Cpp实现
需积分: 12 186 浏览量
2011-11-06
13:08:29
上传
评论
收藏 13KB RAR 举报
colinzouming
- 粉丝: 0
- 资源: 3
最新资源
- 老飞飞搭建基础通用数据库V19数据库.rar
- jquery.js
- 机械设计多工位ACF贴胶带&预压设备sw18可编辑非常好的设计图纸100%好用.zip
- 基于Pytorch复现Point-Transformer,用于ShapeNet数据集点云分割
- 【医学影像分析】2D超声图像的分割检测(Ultrasound Nerve Segmentation - Kaggle数据集)
- 嘎嘎香的五款神仙谷歌插件
- .arch书源导入教程.mp4
- 贪心算法介绍及代码示例讲解
- CR13SP35MSI64 Crystal 水晶报表运行组件最后版本64位
- 图像分类数据集:玉米叶是否感染分类数据集(2分类,包含训练集、验证集)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈