摘要: #include #include using namespace std;template class wqueue{ list m_queue; pthread_mutex_t m_mutex; pthread_cond_t m_condv; public: wqueue() { pthread_mutex_init(&m_mutex, NULL); pthread_cond_init(&m_condv, NULL); } ~wqueue() { pthread_mutex_dest... 阅读全文
posted @ 2013-09-26 17:39 hailong 阅读(464) 评论(0) 推荐(0) 编辑
摘要: 目的:尽量减少read,write调用的次数。标准IO提供3种IO:1.全缓冲。在填满IO缓冲区后才进行实际的IO操作。2.行缓冲。当输入和输出遇到换行符时,执行IO操作。(设计终端)3.不带缓冲。立即进行IO操作。可以用setbuf打开或关闭缓冲机制。 阅读全文
posted @ 2013-09-26 16:35 hailong 阅读(183) 评论(0) 推荐(0) 编辑
摘要: This chapter describes buffering modes used by z/OS XL C/C++ library functions available to control buffering and methods of flushing buffers.z/OS XL C/C++ uses buffers to map C I/O to system-level I/O. When z/OS XL C/C++ performs I/O operations, it uses one of the following buffering modes:Line buf 阅读全文
posted @ 2013-09-26 15:51 hailong 阅读(265) 评论(0) 推荐(0) 编辑
摘要: http://pocoproject.org/index.html有个想法,把这个所谓的跨平台log库阉割成只支持win的,然后使代码尽量简化,高效,以后有时间就开始研究,哈哈。 阅读全文
posted @ 2013-09-26 11:32 hailong 阅读(494) 评论(0) 推荐(0) 编辑
摘要: 二者返回值不同。fopen可以指定宽字符和ASCI。 阅读全文
posted @ 2013-09-26 10:47 hailong 阅读(205) 评论(0) 推荐(0) 编辑