登录
首页 » 操作系统 » 分享一个模拟生产者消费者的小程序

分享一个模拟生产者消费者的小程序

于 2022-10-22 发布 文件大小:1.36 MB
0 90
下载积分: 2 下载次数: 1

代码说明:

实验目的进程同步是操作系统多进程/多线程并发执行的关键之一,进程同步是并发进程为了完成共同任务采用某个条件来协调他们的活动,这是进程之间发生的一种直接制约关系。本次试验是利用信号量进行进程同步。实验软件环境VC++或者Linux操作系统实验内容• 生产者进程生产产品,消费者进程消费产品。 • 当生产者进程生产产品时,如果没有空缓冲区可用,那么生产者进程必须等待消费者进程释放出一个缓冲区。 当消费者进程消费产品时,如果缓冲区中没有产品,那么消费者进程将被阻塞,直到新的产品被生产出来。

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • Zhi LRU replacement pages with FIFO
    页面置换之LRU与FIFO-Zhi LRU replacement pages with FIFO
    2022-08-21 11:47:56下载
    积分:1
  • 通过研究Linux的线程机制和信号量实现读者写者(Reader
    通过研究Linux的线程机制和信号量实现读者写者(Reader-Writer)问题并发控制。 1)写-写互斥:不能有两个写者同时进行写操作; 2)读-写互斥:不能同时有一个线程在读,而另一个线程在写; 3)读-读允许:可以有一个或多个读者在读; 4)读者优先的附加限制:如果读者申请进行读操作时已有另一个读者正在进行读操作,则该读者可直接开始读操作; 5)写者优先的附加限制:如果一个读者申请进行读操作时已有另一个写者在等待访问共享资源,则该读者必须等到没有写者处于等待状态后才能开始读操作。 -By studying the Linux thread mechanism and semaphores realize readers who write (Reader-Writer) the issue of concurrency control. 1) to write- write mutex: Can not write at the same time there are two write operations 2) read- write mutex: Can not have a thread at the same time in reading and writing another thread 3) Reading- Reading of permit: can have one or more readers read 4) the priority of additional restrictions readers: If the readers apply for a read operation, there was another reader being read, the reader can be directly started reading operation 5) to write additional priority Restrictions: If an application for a reader reading write operation has been in waiting for another visit to a shared resource, the read
    2022-02-06 09:26:49下载
    积分:1
  • T-Kernel Shell Sample
    T-Kernel Shell Sample-T-Kernel Shell Sample
    2022-04-30 13:36:50下载
    积分:1
  • 免费dos
    免费dos操作系统-Free dos operating system
    2022-02-09 18:53:55下载
    积分:1
  • MAC OS X开发者手册!
    MAC OS X操作系统开发者手册! -MAC OS X operating system developers manual!
    2022-02-12 10:36:26下载
    积分:1
  • 一个小型雏形,实现了基本的启动以及基础的内存设备管理功能...
    一个小型操作系统雏形,实现了基本的启动以及基础的内存设备管理功能-a small operating system prototype, to achieve the basic infrastructure as well as the start of the memory management functions of equipment
    2022-01-31 21:09:48下载
    积分:1
  • This is a dsp2812 on the transplant procedure, I tested, is very poor, good thin...
    这是一个在dsp2812上移植的程序,本人测试过,很不差,好东西-This is a dsp2812 on the transplant procedure, I tested, is very poor, good things
    2022-01-28 02:02:24下载
    积分:1
  • Bochs是# 20010 #存在巨大的字母2001 #死亡23398 32479 2
    博克斯要么#20010#23398存在死亡巨人字母表2001#32479新2
    2023-03-11 06:10:04下载
    积分:1
  • CPU调度C语言实现 实现1FCFS(先到先服务) 2SJF(最段业优先调度) 3RR(轮转法) 4PSA(优先权调度)n) 5EXIT          6...
    CPU调度C语言实现 实现1FCFS(先到先服务) 2SJF(最段作业优先调度) 3RR(轮转法) 4PSA(优先权调度)n) 5EXIT          6时间的延迟;          7:屏幕的换色.-CPU scheduling C Language Implementation 1FCFS (first come-first services) 2SJF (most of the operational priority scheduling) 3RR (Web) 4PSA (Priority Scheduling) n) 5EXIT six hours of delay; 7 : screen for color.
    2022-02-26 06:57:36下载
    积分:1
  • 朋友_ BIOS源代码
    AMI_BIOS source code
    2022-07-08 13:05:54下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载