会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
zj-studyrecoding
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
3
4
5
6
7
8
9
10
11
···
14
下一页
2023年4月1日
外设、地址总线
摘要: 32位的cpu,地址总线即为32位,它的寻址能力就为2的32次方,即4GB。 cpu可以在0—4G的地址空间对内存、外设进行读写操作 系统总线: 1.地址总线: cpu用来寻址的 2.控制总线: 传输cpu的控制信息 3.数据总线: 同cpu进行数据传输的 虚拟地址(逻辑地址): 程序在启动后,内核
阅读全文
posted @ 2023-04-01 23:52 踏浪而来的人
阅读(226)
评论(0)
推荐(0)
2023年3月31日
指针
摘要: 变量访问的两种方式(取值): 1.通过变量名 2.通过变量的地址(指针) int *p;//指针变量p指向一个int类型的地址 指针变量和数组的区别(int *p、int arr[3]): 1. 指针变量指向的地址是可以变的(即p可以指向不同的整型地址),所以p++是可以的; 而数组名是一个常量(即
阅读全文
posted @ 2023-03-31 22:40 踏浪而来的人
阅读(181)
评论(0)
推荐(0)
2023年3月30日
信号量实例—同步
摘要: //reader_writer.c //reader_writer.c #include <sys/ipc.h> #include <sys/shm.h> #include <sys/types.h> #include <unistd.h> #include <error.h> #include <
阅读全文
posted @ 2023-03-30 10:32 踏浪而来的人
阅读(35)
评论(0)
推荐(0)
2023年3月29日
信号量实例—互斥
摘要: //account.h #ifndef _ACCOUNT_H #define _ACCOUNT_H typedef struct{ int code; double balance; //定义一把互斥锁,用来对多线程操作的银行账户(共享资源)进行加锁(保护)的 /* 建议一把互斥锁和一个共享资源(银
阅读全文
posted @ 2023-03-29 22:50 踏浪而来的人
阅读(65)
评论(0)
推荐(0)
2023年3月28日
进程消息队列实例
摘要: //write.c #include <sys/types.h> #include <sys/ipc.h> #include <sys/msg.h> #include <stdio.h> struct mymesg{ long mtype;//消息的类型,是一个整数且大于0 char mtex[51
阅读全文
posted @ 2023-03-28 17:32 踏浪而来的人
阅读(26)
评论(0)
推荐(0)
信号集操作
摘要: 信号递达:信号的处理动作(绑定的处理函数)。 信号的未决状态:信号从产生到递达之间的状态。 某个信号处于未决状态,一般是因为信号被阻塞(即信号屏蔽字对应的位被置1)了,即当捕获到这个信号时,由于信号处于未决状态,将不会执行信号的处理动作。 int sigemptyset(sigset_t *set)
阅读全文
posted @ 2023-03-28 11:07 踏浪而来的人
阅读(27)
评论(0)
推荐(0)
2023年3月27日
线程和信号
摘要: 线程和信号:
阅读全文
posted @ 2023-03-27 23:04 踏浪而来的人
阅读(21)
评论(0)
推荐(0)
2023年3月26日
多线程的同步和互斥—线程的信号量
摘要: 同步: //account.h #ifndef _ACCOUNT_H #define _ACCOUNT_H #include <pthread.h> #include <semaphore.h> typedef struct{ int code; double balance; //定义一把互斥锁,
阅读全文
posted @ 2023-03-26 23:23 踏浪而来的人
阅读(23)
评论(0)
推荐(0)
多线的的同步—条件变量
摘要: //reader_writer.c #include <pthread.h> #include <stdio.h> #include <unistd.h> /* 写者写完通知读者去读 读者读完通知写者去写 */ typedef struct{ int value; int r_wait; pthre
阅读全文
posted @ 2023-03-26 22:45 踏浪而来的人
阅读(26)
评论(0)
推荐(0)
多线程的互斥—读写锁
摘要: //account.h #ifndef _ACCOUNT_H #define _ACCOUNT_H #include <pthread.h> typedef struct{ int code; double balance; //定义一把互斥锁,用来对多线程操作的银行账户(共享资源)进行加锁(保护)
阅读全文
posted @ 2023-03-26 18:27 踏浪而来的人
阅读(31)
评论(0)
推荐(0)
上一页
1
···
3
4
5
6
7
8
9
10
11
···
14
下一页
公告