随笔分类 -  linux并发应用程序开发

做产品 核心在应用 认清技术重点
该文被密码保护。
posted @ 2020-12-20 12:14 卷哭你 阅读(1) 评论(0) 推荐(0)
摘要:static int fd; static uint64_t buffer; static void threadFunc(void) //线程函数 { int t; eventfd_t value; int ret = -1; while(1) { #if 0 t = read(fd,&buffe 阅读全文
posted @ 2020-12-11 13:37 卷哭你 阅读(261) 评论(0) 推荐(0)
摘要:添加环境变量: (1)找到编译链包,get xxx/bin/路径 (2)临时测试: export ARCH=arm export CROSS_COMPILE=arm-linux-gnueabihf- export PATH=$PATH:xxx/bin/路径 source ~/.bashrc arm- 阅读全文
posted @ 2020-11-13 18:02 卷哭你 阅读(362) 评论(0) 推荐(0)
摘要:#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include "task.h" // static int I2S_Init_flag = 0; int main(int argc,char**argv) { int ch = 阅读全文
posted @ 2020-09-10 19:40 卷哭你 阅读(184) 评论(0) 推荐(0)
摘要:#include <stdio.h> #include <stdlib.h> #include <time.h> #include <pthread.h> #include <semaphore.h> #include <unistd.h> #include <signal.h> static in 阅读全文
posted @ 2020-09-09 23:48 卷哭你 阅读(403) 评论(0) 推荐(0)
摘要:#include <stdio.h> #include <stdlib.h> #include <time.h> #include <pthread.h> #include <semaphore.h> static int pthread_run = 1; static void print(cha 阅读全文
posted @ 2020-09-07 08:43 卷哭你 阅读(341) 评论(0) 推荐(0)
摘要:同步模型: #include <stdio.h> #include <stdlib.h> #include <time.h> #include <pthread.h> #include <semaphore.h> //#define EXIT_SUCCESS 0 //#define EXIT_FAI 阅读全文
posted @ 2020-09-06 23:10 卷哭你 阅读(177) 评论(0) 推荐(0)
摘要:#include "common.h" /** 这种情况一般用于某个多线程调用的模块使用前的初始化,但是无法判定哪个线程先运行,从而不知道把初始化代码放在哪个线程合适的问题。 当然,我们一般的做法是把初始化函数放在main里,创建线程之前来完成,但是如果我们的程序最终不是做成可执行程序,而是编译成库 阅读全文
posted @ 2020-09-03 11:07 卷哭你 阅读(178) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2020-08-31 14:16 卷哭你 阅读(4) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2020-08-25 01:14 卷哭你 阅读(0) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2020-08-24 15:09 卷哭你 阅读(0) 评论(0) 推荐(0)
摘要:、 、 、 谓词就是判断,?? 例子:谓词:if(FD_ISSET(fd, &efds)) 不变量:音频配置参数 i2c配置参数 硬件配置参数 临界区:>2 进程和线程都会访问的串行地方 或变量(复杂构造类型的变量和短变量) 阅读全文
posted @ 2020-08-24 09:44 卷哭你 阅读(194) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2020-08-21 19:28 卷哭你 阅读(2) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2020-08-21 11:50 卷哭你 阅读(5) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2020-08-21 09:31 卷哭你 阅读(4) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2020-08-18 20:57 卷哭你 阅读(1) 评论(0) 推荐(0)
摘要:# pwd /proc/68 # cat status Name: nfsiod State: S (sleeping) Tgid: 68 Ngid: 0 Pid: 68 PPid: 2 TracerPid: 0 Uid: 0 0 0 0 Gid: 0 0 0 0 FDSize: 64 Groups 阅读全文
posted @ 2020-08-18 19:43 卷哭你 阅读(1612) 评论(0) 推荐(0)
摘要:echo 1 > /proc/sys/kernel/sysrq echo b > /proc/sysrq-trigger linux重启命令 (需要两条) du -sh xxx 查看文件夹包含里面大小 (看做整体 全集) ls -lh xxx 查看文件夹内部组件大小 (部分 子集) 阅读全文
posted @ 2020-04-14 19:30 卷哭你 阅读(128) 评论(0) 推荐(0)
摘要:找了半天在glibc里面 阅读全文
posted @ 2020-04-09 11:32 卷哭你 阅读(2908) 评论(0) 推荐(0)
摘要:(1) 线程系统的三个基本要素:执行环境,调度,同步。 同步: 使用互斥量来保护共享数据,使用条件变量来通信,使用条件变量来通信,其他同步机制,如信号量管道和消息队列。互斥量允许线程在访问共享数据 锁定他,以避免其他线程干扰。条件变量允许线程等待共享数据到达某个期望的状态。(队列非空或者资源可用) 阅读全文
posted @ 2020-04-06 11:53 卷哭你 阅读(306) 评论(0) 推荐(0)