- 博客(5)
- 收藏
- 关注
转载 多任务I/O
1、select() #include <sys/types.h>#include <sys/time.h>#include <unistd.h>struct timeval { long tv_sec; ...
2013-09-30 21:18:00
107
转载 Linux多线程-生产者和消费者
#include <unistd.h>#include <pthread.h>#include <errno.h>#include <iostream>#include <cstdlib>#include <...
2013-08-22 19:47:00
113
转载 整数排序——基数排序
看算法,看到用基数排序来对整数进行排序时,算法复杂度为O(n)。赶脚好牛逼的样子,拿来和std::sort比比,不比不知道,一比吓一跳呀。上代码: radix_sort.hpp #include <algorithm>template <...
2013-07-31 13:23:00
222
转载 同步化I/O
1、fsync()和fdatasync() #include <unistd.h>int fsync (int fd);int fdatasync (int fd); fsync()调用可确保文件描述符fd所映射的文件中所有脏数据(数据和元数据)...
2013-07-20 10:01:00
117
转载 vector陷阱
最近研究vector的erase方法时,发现其工作方式和我预想的不一样。先上代码: #include <vector>#include <iostream>#include <string>#include <boost/sh...
2013-04-01 14:17:00
132
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人