![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
linux
文章平均质量分 63
kerwin_zxc
这个作者很懒,什么都没留下…
展开
-
linux 下 automake 生成 makefile
1. autoscan产生 autoscan.log configure.scan2. mv configure.scan configure.in3. vim configure.in原始# -*- Autoconf -*-# Process this file with autoconf原创 2012-08-16 16:15:53 · 446 阅读 · 0 评论 -
linux 命令大全
系统信息 arch 显示机器的处理器架构(1) uname -m 显示机器的处理器架构(2) uname -r 显示正在使用的内核版本 dmidecode -q 显示硬件系统部件 - (SMBIOS / DMI) hdparm -i /dev/hda 罗列一个磁盘的架构特性 hdparm -tT /dev/sda 在磁盘上执行测试性读取操作 cat /proc/cpui原创 2012-08-21 21:04:37 · 410 阅读 · 0 评论 -
dijkstra 算法
#include #include #include #define NUM 5pthread_mutex_t lock[NUM] = {PTHREAD_MUTEX_INITIALIZER};void *thread_proc(void *p){ int pos = (int)p; int right = pos; int left = ((pos - 1) < 0)原创 2012-08-17 11:28:52 · 497 阅读 · 0 评论 -
生产者,消费者,pthread_cond_t pthread_mutex_t
#include #include #include struct msg { struct msg *next; int num;};struct msg *head = NULL;pthread_cond_t has_product = PTHREAD_COND_INITIALIZER;pthread_mutex_t lock = PTHREAD_MUTEX_INITIA原创 2012-08-17 13:41:57 · 1253 阅读 · 0 评论 -
2-bitmap 算法,可解决海量数据问题,减少内存使用
#include "stdafx.h"#include #include using namespace std;unsigned char flags[1000];unsigned get_val(int idx){ int i = idx / 4; int j = idx % 4; unsigned ret = (flags[i]&(0x3> (2*j); retur原创 2012-08-15 15:54:30 · 1028 阅读 · 0 评论 -
进程通信pipe, 输入输出,进程间互相读写
#include #include #include #include #include #define MAXLINE 80void *parent_read_proc(void *p){ int p_fd_r = (int)p; char line[MAXLINE] = {0}; int len = 0; int n = 0; while(1) { memse原创 2012-08-17 11:38:09 · 1329 阅读 · 0 评论 -
线程同步 pthread_mutex_t pthread_cond_t sem_t
pthread_cond_t #include #include #include struct msg { struct msg *next; int num;};struct msg *head = NULL;pthread_cond_t has_product = PTHREAD_COND_INITIALIZER;pthread_mutex_t lock = P原创 2012-08-17 13:53:31 · 2022 阅读 · 0 评论 -
信号模拟 sleep 函数,定时器
#include #include #include void sig_alrm(int signo){ printf("this is the alarm function\n");}unsigned int mysleep(unsigned int nsecs, __sighandler_t handler){ struct sigaction newact, oldac原创 2012-08-17 11:36:09 · 505 阅读 · 0 评论 -
linux C++ 资料集合
GCC 中文手册 http://www.nbfan.com/forum/dispbbs....&ID=1433&page=1 GNU make 指南 http://www.linuxsir.org/bbs/showthr...&threadid=40431 autoconf-2.57手册(英文)原创 2012-08-17 16:53:08 · 627 阅读 · 0 评论 -
Mysql Master/Slave备份
准备工作:1.保证Master/Slave两台主机上mysql的版本一致,避免不必要的麻烦。2.保证Master/Slave能够互相ping通,能够通信。Master主机IP:192.168.1.1Slave主机IP:192.168.1.2配置my.ini:Master - my.ini在[mysqld]下添加:log-bin = mysql-bin #因为原创 2012-08-17 14:52:44 · 795 阅读 · 0 评论 -
linux 积累
1. 查找一个文本中某个单词出现的次数cat aaa.txt |grep unix|wc -l2. 网址http://linux.chinaitlab.com/special/linuxcom/原创 2012-08-21 21:12:10 · 380 阅读 · 0 评论