?????????????????????
???????????? ???????[ 2013/4/23 10:09:30 ] ????????
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
?????????????????????????????????????????????棬?????????????????????????????е???????У????????????????е?????????????????????ζ??к?lock-free????????У???????????????????????????塢????????????????????????У?????????ο??????java??blockingqueue?????????????????м?????????????????????У?????????????????????????????????????????С????????????Щbuff??????????????????????????
????????????????????????????????????????????
????1??????????????????????????????????????????????????????????????????д?????????????????????????????????
????2??????????????IO????????????IO??????????????д???£????????????????????????????????????IO?????????IO??????????????????????
????3????????????????2 ???????????????????????????
?????????????
????BlockingQueue.h???
/*
* BlockingQueue.h
*
* Created on: Apr 19?? 2013
* Author: archy_yu
*/
#ifndef BLOCKINGQUEUE_H_
#define BLOCKINGQUEUE_H_
#include <queue>
#include <pthread.h>
typedef void* CommonItem;
class BlockingQueue
{
public:
BlockingQueue();
virtual ~BlockingQueue();
int peek(CommonItem &item);
int append(CommonItem item);
private:
pthread_mutex_t _mutex;
pthread_cond_t _cond;
std::queue<CommonItem> _read_queue;
std::queue<CommonItem> _write_queue;
};
#endif /* BLOCKINGQUEUE_H_ */
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11