Mike Liu 2207ea4ce9
Translation zh (#1646)
* add state and callback pattern

* add command and template-method pattern

* add iterator pattern

* add bridege and DI pattern

* fix issue #1600

* add converter,proxy,visitor pattern

* add caching,composite,delegation,dirty-flag,interpreter patterns

* add dao and producer-consumer

* add dto and provate class data pattern

* fix #1646 png path problems

* fix #1646 composite png path case problem

Co-authored-by: Mike <admin@xiaod.info>
Co-authored-by: Subhrodip Mohanta <hello@subho.xyz>
2021-02-08 21:07:48 +05:30
..
2021-02-08 21:07:48 +05:30

layout, title, folder, permalink, categories, tags
layout title folder permalink categories tags
pattern Producer Consumer producer-consumer /patterns/producer-consumer/ Concurrency
Reactive

目的

生产者消费者设计模式是一种经典的并发模式,通过将工作与执行工作任务分开来减少生产者与消费者之间的耦合。

类图

alt text

适用性

在以下情况下使用生产者消费者

  • 通过将工作分成生产和消费两个工作进程来解耦系统
  • 解决生产工作和消费工作需要不同时间的问题