摘要: #if 0 Linux实现生产者消费者模型 1. 防止虚假唤醒 2. 唤醒线程的时机很重要,否则会导致线程多次访问锁,影响性能 #endif #include <unistd.h> #include <stdio.h> #include <iostream> #include <pthread.h> using namespace std; int g_value = 0; pthread_mut 阅读全文
posted @ 2019-08-20 14:21 c&z 阅读(1101) 评论(0) 推荐(0)