摘要: /*************** 进程A ****************/ #include <stdio.h> #include <sys/ipc.h> #include <sys/shm.h> #include <errno.h> #include <string.h> #include <u 阅读全文
posted @ 2026-09-19 00:28 謹 阅读(2) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <semaphore.h> #include <strings.h> #include <string.h> #include <errno.h> #include <pthread.h> char buf[30]; sem_t sem; // 阅读全文
posted @ 2026-09-18 23:37 謹 阅读(4) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <pthread.h> #include <errno.h> #include <string.h> #include <unistd.h> int x; // 临界资源 pthread_mutex_t mutex = PTHREAD_MUTE 阅读全文
posted @ 2026-09-18 00:00 謹 阅读(5) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <pthread.h> #include <unistd.h> pthread_t pid; //存储主线程id void *con_do(void *arg){ int *main_statu; // 1.等待主线程结束并回收资源 pthre 阅读全文
posted @ 2026-09-17 17:59 謹 阅读(2) 评论(0) 推荐(0)
摘要: /**************** 进程A ****************/ #include <sys/ipc.h> #include <sys/shm.h> #include <sys/sem.h> #include <stdio.h> #include <errno.h> #include 阅读全文
posted @ 2026-09-16 17:36 謹 阅读(5) 评论(0) 推荐(0)
摘要: /************** 进程A *************/ #include <stdio.h> #include <sys/ipc.h> #include <sys/shm.h> #include <error.h> #include <errno.h> #include <signal 阅读全文
posted @ 2026-09-15 19:03 謹 阅读(6) 评论(0) 推荐(0)
摘要: /************** 进程A *************/ #include <sys/ipc.h> #include <sys/msg.h> #include <stdlib.h> #include <stdio.h> #include <signal.h> key_t key; int 阅读全文
posted @ 2026-09-14 23:56 謹 阅读(7) 评论(0) 推荐(0)
摘要: /*************** 进程A **************/ #include <signal.h> #include <stdio.h> int count = 0; // 自定义函数,接收到SIGUSR1信号后打印count数据 void printf_string(int sig) 阅读全文
posted @ 2026-09-12 21:48 謹 阅读(5) 评论(0) 推荐(0)
摘要: /*************** 进程A *************/ #include <stdio.h> #include <fcntl.h> #include <unistd.h> #include <time.h> #include <sys/types.h> #include <sys/s 阅读全文
posted @ 2026-09-12 00:47 謹 阅读(6) 评论(0) 推荐(0)
摘要: /* * * 文件名:display_chinese.c * 功能:在 LCD 屏幕(1280x800)上显示一个 16x16 点阵汉字 * 说明: * - 使用 mmap 映射 /dev/fb0 显存,实现直接像素操作 * - 字库文件:HZK2312.Dzk(GB2312 16x16 点阵汉字库 阅读全文
posted @ 2026-08-25 20:08 謹 阅读(13) 评论(0) 推荐(0)