生产者消费者

所属分类进程与线程
开发工具:C/C++
文件大小:12574KB
下载次数:0
上传日期:2019-05-03 16:43:43
上 传 者弟弟dddddd
说明:  因为不同的“生产者”生产的商品可以放在不同的店中销售,而不同的“消费者”可以去不同的店中购买,所以生产者与消费者存在同步关系,而且各个生产者之间、各个消费者之间存在互斥关系,他们必须互斥地访问缓冲区。 “生产者”进程不断向缓冲区写人数据,而“消费者”进程不断从缓冲区读出数据;共享缓冲区共有n个;任何时刻只能有一个进程可对共享缓冲区进行操作,设置三个信号量:full、empty和mutex。其中:full(g_hFullItems)表示有数据的缓冲块数目,初值是0;empty(g_hEmptyItems)表示空的缓冲块数初值是n;mutex(g_hMutex)用于访问缓冲区时的互斥,初值是1
(Because products produced by different producers can be sold in different stores and different consumers can buy in different stores, there is a synchronous relationship between producers and consumers, and there is a mutually exclusive relationship between producers and consumers. They must mutually exclusive access to the buffer. The "producer" process continuously writes data to the buffer, while the "consumer" process reads data from the buffer; there are n shared buffers; only one process can operate on the shared buffer at any time, setting three semaphores: full, empty and mutex. Among them: full (g_hFull Items) denotes the number of buffer blocks with data, and the initial value is 0; empty (g_hEmpty Items) denotes that the initial value of empty buffer blocks is n; mutex (g_hMutex) is used to access the buffer, and the initial value is 1.)

文件列表:[举报垃圾]
生产者消费者, 0 , 2018-12-16
生产者消费者\Debug, 0 , 2018-12-16
生产者消费者\Debug\生产者消费者.exe, 71680 , 2018-12-16
生产者消费者\Debug\生产者消费者.ilk, 390188 , 2018-12-16
生产者消费者\Debug\生产者消费者.pdb, 822272 , 2018-12-16
生产者消费者\ipch, 0 , 2018-12-16
生产者消费者\ipch\生产者消费者-3dc3d3bf, 0 , 2018-12-16
生产者消费者\ipch\生产者消费者-3dc3d3bf\生产者消费者-6efed5fd.ipch, 2949120 , 2018-12-16
生产者消费者\生产者消费者, 0 , 2018-12-16
生产者消费者\生产者消费者.sdf, 35127296 , 2018-12-16
生产者消费者\生产者消费者.sln, 921 , 2018-12-16
生产者消费者\生产者消费者.v11.suo, 17408 , 2018-12-16
生产者消费者\生产者消费者\Debug, 0 , 2018-12-16
生产者消费者\生产者消费者\Debug\cl.command.1.tlog, 1246 , 2018-12-16
生产者消费者\生产者消费者\Debug\CL.read.1.tlog, 22718 , 2018-12-16
生产者消费者\生产者消费者\Debug\CL.write.1.tlog, 538 , 2018-12-16
生产者消费者\生产者消费者\Debug\link-cvtres.read.1.tlog, 2 , 2018-12-16
生产者消费者\生产者消费者\Debug\link-cvtres.write.1.tlog, 2 , 2018-12-16
生产者消费者\生产者消费者\Debug\link-rc.read.1.tlog, 2 , 2018-12-16
生产者消费者\生产者消费者\Debug\link-rc.write.1.tlog, 2 , 2018-12-16
生产者消费者\生产者消费者\Debug\link.command.1.tlog, 1092 , 2018-12-16
生产者消费者\生产者消费者\Debug\link.read.1.tlog, 2488 , 2018-12-16
生产者消费者\生产者消费者\Debug\link.write.1.tlog, 360 , 2018-12-16
生产者消费者\生产者消费者\Debug\stdafx.obj, 11316 , 2018-12-16
生产者消费者\生产者消费者\Debug\vc110.idb, 691200 , 2018-12-16
生产者消费者\生产者消费者\Debug\vc110.pdb, 471040 , 2018-12-16
生产者消费者\生产者消费者\Debug\生产者消费者.lastbuildstate, 68 , 2018-12-16
生产者消费者\生产者消费者\Debug\生产者消费者.log, 1874 , 2018-12-16
生产者消费者\生产者消费者\Debug\生产者消费者.obj, 191077 , 2018-12-16
生产者消费者\生产者消费者\Debug\生产者消费者.pch, 1245184 , 2018-12-16
生产者消费者\生产者消费者\ReadMe.txt, 1587 , 2018-12-16
生产者消费者\生产者消费者\stdafx.cpp, 217 , 2018-12-16
生产者消费者\生产者消费者\stdafx.h, 233 , 2018-12-16
生产者消费者\生产者消费者\targetver.h, 236 , 2018-12-16
生产者消费者\生产者消费者\生产者消费者.cpp, 4139 , 2018-12-16
生产者消费者\生产者消费者\生产者消费者.vcxproj, 4544 , 2018-12-16
生产者消费者\生产者消费者\生产者消费者.vcxproj.filters, 1322 , 2018-12-16

近期下载者

相关文件

评论我要评论

收藏者