Mic_chen

It is not the strongest of the species that survive, nor the most intelligent, but the one most responsive to change

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2020年12月10日

摘要: 生产者消费模式: 生产者生产数据到缓冲区中,消费者从缓冲区中取数据。 如果缓冲区已经满了,则生产者线程阻塞; 如果缓冲区为空,那么消费者线程阻塞。 特点是当多个消费者监听消息队列,一旦消息到达,消费者马上消费,谁先抢到算谁的,如果队列里没有消息,则消费者继续监听。 发布订阅者(观察者)模式: 和生产 阅读全文
posted @ 2020-12-10 17:00 Mic_chen 阅读(243) 评论(0) 推荐(0) 编辑