yanyiwu / limonp

C++ headers(hpp) library with Python style.
MIT License
125 stars 43 forks source link

关于 BoundedBlockingQueue 的加锁操作。 #16

Open daghlny opened 6 years ago

daghlny commented 6 years ago

因为都是中国人,我就直接打中文了。。。 BoundedBlockingQueue 有 Push 和 Pop 两个操作,这两个函数刚开始的时候都会锁住 mutex 成员变量,那么如果此时队列是 Full 的,用户 Push 不进去数据,同时其他用户 Pop 时也因为获取不了 mutex 而阻塞,那么各个用户(线程)都陷入死锁了吧? 可能有些我没考虑到的因素,请指点。。

github-actions[bot] commented 2 weeks ago

This issue has not been updated for over a year and will be marked as stale. If the issue still exists, please comment or update the issue, otherwise it will be closed after 7 days.