Hot Search : Source embeded web remote control p2p game More...
Location : Home Downloads SourceCode Windows Develop Process-Thread

BarberAndCustomer

  • Category : Process-Thread
  • Tags :
  • Update : 2012-11-26
  • Size : 3.27mb
  • Downloaded :0次
  • Author :陈****
  • About : Nobody
  • PS : If download it fails, try it again. Download again for free!
Download1 Download2
Don't use download software fo downloading.
If download fail,Try it again for free.
Introduction - If you have any usage issues, please Google them yourself
1)用C语言或C++语言编程实现P、V原语并用P、V原语描述如下生产者-消费者问题: 有一个理发师,一把理发椅和n把提供给等候理发的顾客座的椅子。如果没有顾客,则理发师便在理发椅子上睡觉;当第一个顾客到来时,必须唤醒该理发师进行理发;如果理发师正在理发时又有顾客到来,则如果有空椅子可坐,他就坐下来等待,如果没有空椅子,他就离开理发店。 为理发师和顾客各编一段程序描述他们的行为,要求不能带有竞争条件,试用P、V操作实现。 (2)分析 此题可看作是n个生产者和1个消费者问题。 顾客作为生产者,每到来一个就使计数器rc增加1,以便让理发师理发(相当于消费)至最后一个顾客(相当于产品)。并且,第1个到来的顾客应负责唤醒理发师;如果不是第1个到达的顾客,则在有空椅子的情况下坐下等待,否则离开理发店(该消息可由计数器rc获得)。
Packet file list
(Preview for download)
BarberAndCustomer\Barber\barber.cpp
.................\......\Barber.vcproj
.................\......\Barber.vcproj.MICROSOF-5AF945.Administrator.user
.................\......\Debug\Barber.exe.embed.manifest
.................\......\.....\Barber.exe.embed.manifest.res
.................\......\.....\Barber.exe.intermediate.manifest
.................\......\.....\barber.obj
.................\......\.....\BuildLog.htm
.................\......\.....\mt.dep
.................\......\.....\vc90.idb
.................\......\.....\vc90.pdb
.................\BarberAndCustomer.ncb
.................\BarberAndCustomer.sln
.................\BarberAndCustomer.suo
.................\Customer\Customer.cpp
.................\........\Customer.vcproj
.................\........\Customer.vcproj.MICROSOF-5AF945.Administrator.user
.................\........\Debug\BuildLog.htm
.................\........\.....\Customer.exe.embed.manifest
.................\........\.....\Customer.exe.embed.manifest.res
.................\........\.....\Customer.exe.intermediate.manifest
.................\........\.....\Customer.obj
.................\........\.....\mt.dep
.................\........\.....\vc90.idb
.................\........\.....\vc90.pdb
.................\Debug\Barber.exe
.................\.....\Barber.ilk
.................\.....\Barber.pdb
.................\.....\Customer.exe
.................\.....\Customer.ilk
.................\.....\Customer.pdb
.................\.....\QueueCustomer.dll
.................\.....\QueueCustomer.exp
.................\.....\QueueCustomer.ilk
.................\.....\QueueCustomer.lib
.................\.....\QueueCustomer.pdb
.................\Instruction.txt
.................\QueueCustomer\Debug\BuildLog.htm
.................\.............\.....\mt.dep
.................\.............\.....\QueueCustomer.dll.embed.manifest
.................\.............\.....\QueueCustomer.dll.embed.manifest.res
.................\.............\.....\QueueCustomer.dll.intermediate.manifest
.................\.............\.....\QueueCustomer.obj
.................\.............\.....\vc90.idb
.................\.............\.....\vc90.pdb
.................\.............\QueueCustomer.cpp
.................\.............\QueueCustomer.h
.................\.............\QueueCustomer.vcproj
.................\.............\QueueCustomer.vcproj.MICROSOF-5AF945.Administrator.user
.................\Barber\Debug
.................\Customer\Debug
.................\QueueCustomer\Debug
.................\Barber
.................\Customer
.................\Debug
.................\QueueCustomer
BarberAndCustomer
Related instructions
  • We are an exchange download platform that only provides communication channels. The downloaded content comes from the internet. Except for download issues, please Google on your own.
  • The downloaded content is provided for members to upload. If it unintentionally infringes on your copyright, please contact us.
  • Please use Winrar for decompression tools
  • If download fail, Try it againg or Feedback to us.
  • If downloaded content did not match the introduction, Feedback to us,Confirm and will be refund.
  • Before downloading, you can inquire through the uploaded person information

Nothing.

Post Comment
*Quick comment Recommend Not bad Password Unclear description Not source
Lost files Unable to decompress Bad
*Content :
*Captcha :
CodeBus is one of the largest source code repositories on the Internet!
Contact us :
1999-2046 CodeBus All Rights Reserved.