Skip to content

Commit ae26103

Browse files
author
yuanye
committed
Add description for producer-consumer project
1 parent b044221 commit ae26103

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ C++ 实现的环形缓冲区,在单生产者单消费者情况下不需要锁
2222

2323
- **tcpserver** <br/>
2424
与业务解耦的常用 tcpserver 实现
25+
26+
- **producer-consumer** <br/>
27+
使用环形缓冲区的 producer-consumer pattern

producer-consumer/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# 生产者-消费者
2+
经典问题,不多介绍,留着随时查看备忘。
3+
4+
这个小 demo 的主要特点是:
5+
- 使用环形缓冲区
6+
- 自己写了一个较为完善的类
7+
- 仅使用一个 mutex 和一个 condition_variable
8+
- 有的代码里使用两个分别表示满和空,不理解这么做的意图

0 commit comments

Comments
 (0)