CDN加速镜像 | 设为首页 | 加入收藏夹
当前位置: 首页 资源下载 源码下载 Windows编程 进程与线程

文件名称:BarberAndCustomer

介绍说明--下载内容来自于网络,使用问题请自行百度

  1)用C语言或C++语言编程实现P、V原语并用P、V原语描述如下生产者-消费者问题:

  有一个理发师,一把理发椅和n把提供给等候理发的顾客座的椅子。如果没有顾客,则理发师便在理发椅子上睡觉;当第一个顾客到来时,必须唤醒该理发师进行理发;如果理发师正在理发时又有顾客到来,则如果有空椅子可坐,他就坐下来等待,如果没有空椅子,他就离开理发店。

  为理发师和顾客各编一段程序描述他们的行为,要求不能带有竞争条件,试用P、V操作实现。

  (2)分析

  此题可看作是n个生产者和1个消费者问题。

  顾客作为生产者,每到来一个就使计数器rc增加1,以便让理发师理发(相当于消费)至最后一个顾客(相当于产品)。并且,第1个到来的顾客应负责唤醒理发师;如果不是第1个到达的顾客,则在有空椅子的情况下坐下等待,否则离开理发店(该消息可由计数器rc获得)。
(系统自动生成,下载前可以参看下载内容)

下载文件列表

BarberAndCustomer/Barber/barber.cpp
BarberAndCustomer/Barber/Barber.vcproj
BarberAndCustomer/Barber/Barber.vcproj.MICROSOF-5AF945.Administrator.user
BarberAndCustomer/Barber/Debug/Barber.exe.embed.manifest
BarberAndCustomer/Barber/Debug/Barber.exe.embed.manifest.res
BarberAndCustomer/Barber/Debug/Barber.exe.intermediate.manifest
BarberAndCustomer/Barber/Debug/barber.obj
BarberAndCustomer/Barber/Debug/BuildLog.htm
BarberAndCustomer/Barber/Debug/mt.dep
BarberAndCustomer/Barber/Debug/vc90.idb
BarberAndCustomer/Barber/Debug/vc90.pdb
BarberAndCustomer/BarberAndCustomer.ncb
BarberAndCustomer/BarberAndCustomer.sln
BarberAndCustomer/BarberAndCustomer.suo
BarberAndCustomer/Customer/Customer.cpp
BarberAndCustomer/Customer/Customer.vcproj
BarberAndCustomer/Customer/Customer.vcproj.MICROSOF-5AF945.Administrator.user
BarberAndCustomer/Customer/Debug/BuildLog.htm
BarberAndCustomer/Customer/Debug/Customer.exe.embed.manifest
BarberAndCustomer/Customer/Debug/Customer.exe.embed.manifest.res
BarberAndCustomer/Customer/Debug/Customer.exe.intermediate.manifest
BarberAndCustomer/Customer/Debug/Customer.obj
BarberAndCustomer/Customer/Debug/mt.dep
BarberAndCustomer/Customer/Debug/vc90.idb
BarberAndCustomer/Customer/Debug/vc90.pdb
BarberAndCustomer/Debug/Barber.exe
BarberAndCustomer/Debug/Barber.ilk
BarberAndCustomer/Debug/Barber.pdb
BarberAndCustomer/Debug/Customer.exe
BarberAndCustomer/Debug/Customer.ilk
BarberAndCustomer/Debug/Customer.pdb
BarberAndCustomer/Debug/QueueCustomer.dll
BarberAndCustomer/Debug/QueueCustomer.exp
BarberAndCustomer/Debug/QueueCustomer.ilk
BarberAndCustomer/Debug/QueueCustomer.lib
BarberAndCustomer/Debug/QueueCustomer.pdb
BarberAndCustomer/Instruction.txt
BarberAndCustomer/QueueCustomer/Debug/BuildLog.htm
BarberAndCustomer/QueueCustomer/Debug/mt.dep
BarberAndCustomer/QueueCustomer/Debug/QueueCustomer.dll.embed.manifest
BarberAndCustomer/QueueCustomer/Debug/QueueCustomer.dll.embed.manifest.res
BarberAndCustomer/QueueCustomer/Debug/QueueCustomer.dll.intermediate.manifest
BarberAndCustomer/QueueCustomer/Debug/QueueCustomer.obj
BarberAndCustomer/QueueCustomer/Debug/vc90.idb
BarberAndCustomer/QueueCustomer/Debug/vc90.pdb
BarberAndCustomer/QueueCustomer/QueueCustomer.cpp
BarberAndCustomer/QueueCustomer/QueueCustomer.h
BarberAndCustomer/QueueCustomer/QueueCustomer.vcproj
BarberAndCustomer/QueueCustomer/QueueCustomer.vcproj.MICROSOF-5AF945.Administrator.user
BarberAndCustomer/Barber/Debug
BarberAndCustomer/Customer/Debug
BarberAndCustomer/QueueCustomer/Debug
BarberAndCustomer/Barber
BarberAndCustomer/Customer
BarberAndCustomer/Debug
BarberAndCustomer/QueueCustomer
BarberAndCustomer

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 搜珍网是交换下载平台,只提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。更多...
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或换浏览器;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*快速评论: 推荐 一般 有密码 和说明不符 不是源码或资料 文件不全 不能解压 纯粹是垃圾
*内  容:
*验 证 码:
搜珍网 www.dssz.com