会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
ForMeDream
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
下一页
2019年3月2日
指定linux 下默认python版本
摘要: sudo rm -rf python sudo ln -s /usr/bin/python3 /usr/bin/python
阅读全文
posted @ 2019-03-02 14:03 ForMeDream
阅读(3196)
评论(0)
推荐(0)
2019年2月28日
linux select函数
摘要: /**两个线程一个负责监听客户端,一个负责读客户端请求。 服务器模型,*主控线程负责accept监听链接的客户端,*把客户端fd放入任务队列中(),分离子线程则从任务队列取出所有的*客户端描述加入select并处理客户端读请求。*13:06:22*/#include #include #include #include #include #include #include #include #i...
阅读全文
posted @ 2019-02-28 13:00 ForMeDream
阅读(905)
评论(0)
推荐(0)
2019年2月26日
Linux 进程信号量
摘要: #include #include #include #include #include #include #include #include union semun { int val; /* Value for SETVAL */ struct semid_ds *buf; /* Buffer...
阅读全文
posted @ 2019-02-26 21:11 ForMeDream
阅读(175)
评论(0)
推荐(0)
linux 消息队列
摘要: /* *删除 msgctl(msgid,IPC_RMID,0); ipcrm -q id ipcs -q 查看 *创建 msgqueue 时指定 key 为 IPC_PRIVATE 读取时将不能获得key指定的队列,所以需要自己定key */ #include #include #include #include #include #include #include char path...
阅读全文
posted @ 2019-02-26 16:29 ForMeDream
阅读(544)
评论(0)
推荐(0)
linux 线程间发送信号
摘要: 线程间通过 pthread_kill(thid,signo)给指定的thid线程发送signo信号。 创建线程与线程屏蔽字顺序 1. pthread_create(); pthread_sigmask(); 线程创建在前。所以子线程没有继承主线程的接下来设置的屏蔽字。子线程依然可以响应主线程接下来要
阅读全文
posted @ 2019-02-26 02:49 ForMeDream
阅读(1909)
评论(0)
推荐(0)
2019年2月25日
linux 信号量sem实现 生产者—消费者(线程间通信)
摘要: #include #include #include #include #include #include typedef struct{ int wrok;//线程间通信 标志位 信号灯 int data;//数据 int num; pthread_t rd;//读线程 pthread_t wr;//写线程 sem_t sem;//控制信号量 ...
阅读全文
posted @ 2019-02-25 18:08 ForMeDream
阅读(1330)
评论(0)
推荐(0)
Linux 创建静态库.a
摘要: gcc -c 只编译不连接 -o *.o(生成.o文件) ar crv name.a *.o *.o (ar 命令把 .o文件打包成 name.a 静态库) 测试 name.a -L 紧跟链接库的路径 -l 库名 -l 库名
阅读全文
posted @ 2019-02-25 17:47 ForMeDream
阅读(400)
评论(0)
推荐(0)
2019年2月24日
linux 互斥锁
摘要: 1 #include 2 #include 3 #include 4 #include 5 6 int num=0; 7 pthread_mutex_t lock; 8 pthread_t th; 9 10 11 void* th_handler(void* p){ 12 int i=0; 13 for(;i<10;i++){ 14 pth...
阅读全文
posted @ 2019-02-24 14:45 ForMeDream
阅读(159)
评论(0)
推荐(0)
c 二级指针
摘要: 二级指针 指针的指针
阅读全文
posted @ 2019-02-24 02:20 ForMeDream
阅读(125)
评论(0)
推荐(0)
循环队列
摘要: #include<stdio.h>#include<stdlib.h>#include<unistd.h>#define MAX 500typedef struct{ int head; int tail; int* que; int num;}QUE;void initQueue(QUE* q){
阅读全文
posted @ 2019-02-24 00:16 ForMeDream
阅读(133)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
下一页
公告