登录
首页 » Linux-Unix program » 在同一个进程地址空间内执行的两个线程。生产者线程生产物品,然后将物品放置在一个空缓冲区中供消费者线程消费。消费者线程从缓冲区中获得物品,然后释放缓冲区。当生产者...

在同一个进程地址空间内执行的两个线程。生产者线程生产物品,然后将物品放置在一个空缓冲区中供消费者线程消费。消费者线程从缓冲区中获得物品,然后释放缓冲区。当生产者...

于 2022-03-10 发布 文件大小:622.00 B
0 208
下载积分: 2 下载次数: 1

代码说明:

在同一个进程地址空间内执行的两个线程。生产者线程生产物品,然后将物品放置在一个空缓冲区中供消费者线程消费。消费者线程从缓冲区中获得物品,然后释放缓冲区。当生产者线程生产物品时,如果没有空缓冲区可用,那么生产者线程必须等待消费者线程释放出一个空缓冲区。当消费者线程消费物品时,如果没有满的缓冲区,那么消费者线程将被阻塞,直到新的物品被生产出来。-In the same address space of a process implemented within the two threads. The producer thread production of goods, and then items placed in an empty buffer in the thread consumption for consumers. Consumer thread to acquire items from the buffer, and then release the buffer. When the producer thread is the production of goods, if there is no empty buffers are available, then the producer thread must wait for the Consumer thread to release an empty buffer. When a consumer thread consumer goods, if the buffer is not full, then the consumer thread will be blocked until the new items were produced.

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

发表评论

0 个回复

  • Linux 是一个源码开放的操作系统,无论是普通用户还是企业用户都可以编写自己的内核代码,再加上对标准内核的裁剪从而制作出适合自己的操作系统。目前有很多中低端用...
    Linux 是一个源码开放的操作系统,无论是普通用户还是企业用户都可以编写自己的内核代码,再加上对标准内核的裁剪从而制作出适合自己的操作系统。目前有很多中低端用户使用的网络设备的操作系统是从标准 Linux 改进而来的,这也说明了有越来越多的人正在加入到 Linux 内核开发团体中。 一个或多个内核模块的实现并不能满足一般 Linux 系统软件的需要,因为内核的局限性太大,如不能在终端上打印,不能做大延时的处理等等。当我们需要做这些的时候,就需要将在内核态采集到的数据传送到用户态的一个或多个进程中进行处理。这样,内核态与用户空间进程通信的方法就显得尤为重要。在 Linux 的内核发行版本中没有对该类通信方法的详细介绍,也没有其他文章对此进行总结,所以本文将列举几种内核态与用户态进程通信的方法并详细分析它们的实现和适用环境。 source code 2 -Linux is an open-source operating system, both ordinary users or enterprises, users can prepare their core code, coupled with the standard kernel cutting thereby making up their own operating system. There are a lot of low-end users of the network equipment from the standard operating system Linux is improving from the This also shows that the more and more people are added to the Linux kernel development groups. One or more modules and the realization of general Linux can not satisfy the needs of system software, because the core is too restrictive, such as the terminal can print, can not handle the b
    2022-01-26 00:11:59下载
    积分:1
  • latest version of the libosip2
    最新版本的libosip2-latest version of the libosip2
    2022-05-13 17:43:25下载
    积分:1
  • 字符串指针,以探讨指针如何工作
    String Pointers to explore how the pointer work -The program takes lines from standard input and keeps the last n of them in memory as it goes through standard input. When it gets to an EOF, it prints the last n lines out. You may assume n is less than 2000 and each individual line is not longer than 1000 including the newline and the null terminator.
    2022-02-01 01:57:48下载
    积分:1
  • 一个巴西大学编写的2D仿真组足球机器人程序
    一个巴西大学编写的2D仿真组足球机器人程序-University prepared a Brazilian group 2D simulation robot soccer program
    2022-02-19 22:41:47下载
    积分:1
  • 《Linux新手指南》是供linux新手参考和查阅的书籍,内容浅显易懂,适合新接触此操作系统的人使用...
    《Linux新手指南》是供linux新手参考和查阅的书籍,内容浅显易懂,适合新接触此操作系统的人使用- Linux Newbie Guide are available for novice linux reference and access to books, the content easy to understand and suitable for contact with this new operating system to use
    2022-12-10 18:25:03下载
    积分:1
  • Linux caozuozhidao
    elecfans.com-Linux操作指导专题-Linux caozuozhidao
    2023-06-14 12:35:04下载
    积分:1
  • QL2000卡的驱动程序,可以学习驱动的编程. 对于UNIX的I/O操作有帮助!...
    QL2000卡的驱动程序,可以学习驱动的编程. 对于UNIX的I/O操作有帮助!-QL2000 card drivers, drivers can learn programming. For UNIX the I/O operation has to help!
    2022-02-09 22:12:51下载
    积分:1
  • creating daemons example
    创建守护进程的例子-creating daemons example
    2022-03-20 11:54:19下载
    积分:1
  • 一个功能比较强的下载软件,可以支持多个协议HTTP,FTP等
    一个功能比较强的下载软件,可以支持多个协议HTTP,FTP等-a strong function of downloading software can support multiple protocols HTTP, FTP, etc.
    2023-06-26 18:10:05下载
    积分:1
  • 44b0+uclinux rtl8019网络驱动程序
    44b0+uclinux rtl8019网络驱动程序-44b0+uclinux rtl8019 net driver code
    2022-02-24 21:55:02下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载