• 博客园Logo
  • 首页
  • 新闻
  • 博问
  • 专区
  • 闪存
  • 班级
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 简洁模式 ... 退出登录
    注册 登录
HSJtl
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理

2022年11月10日

进程间通信-信号-pipe-fifo
摘要: 编译运行附件中的代码,提交运行结果截图 理解代码,特别是相关系统调用的使用。 testmf.c #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> int main() { int r 阅读全文
posted @ 2022-11-10 16:14 HSJtl 阅读(1) 评论(0) 推荐(0) 编辑
 
thread同步测试
摘要: 1 编译运行附件中的代码,提交运行结果截图,并说明程序功能 2 修改代码,把同步资源个数减少为3个,把使用资源的线程增加到 (你的学号%3 + 4)个,编译代码,提交修改后的代码和运行结果截图 1. #include <stdio.h> #include <pthread.h> #include < 阅读全文
posted @ 2022-11-10 16:13 HSJtl 阅读(5) 评论(0) 推荐(0) 编辑
 
thread互斥测试
摘要: 编译运行附件中的代码,并说明程序的功能 根据自己的理解,提交不少于3张图片 代码如下 #include <stdio.h> #include <stdlib.h> #include <pthread.h> #include <ctype.h> struct arg_set { char *fname 阅读全文
posted @ 2022-11-10 16:13 HSJtl 阅读(4) 评论(0) 推荐(0) 编辑
 
读者-写者(多线程)
摘要: 1 描述操作系统中“读者-写者”问题,理解问题的本质,提交你理解或查找到的文本资料 2 利用多线程完成reader 和writer 3 在main中测试若干个reader 和writer的测试,提交截图说明代码的正确性 1.“读者-写者”问题 一个数据文件或记录可以为多个并发进程所共享。称之需要读该 阅读全文
posted @ 2022-11-10 16:12 HSJtl 阅读(15) 评论(0) 推荐(0) 编辑
 
进程间通信测试-signal
摘要: 基于sigaction编写一个信号处理程序,按下CTRL+C,打印奇数随机数,按下CTRL+\,打印偶数随机数,提交代码和运行结果截图 #include <stdio.h> #include <string.h> #include <signal.h> #include <unistd.h> #in 阅读全文
posted @ 2022-11-10 10:08 HSJtl 阅读(13) 评论(0) 推荐(0) 编辑
 
多进程测试2
摘要: 编写多进程程序,主线程中开启两个线程,一个线程打印十个偶数随机数,一个线程打印十个奇数随机数 #include <unistd.h> #include <stdlib.h> #include <pthread.h> #include <stdio.h> int g_num = 1; pthread_ 阅读全文
posted @ 2022-11-10 10:06 HSJtl 阅读(1) 评论(0) 推荐(0) 编辑
 
多进程测试1
摘要: 编写程序 rxx(xx为你学号后两位), rxx -o 生成并打印一个奇数随机数,rxx -e 生成并打印一个偶数随机数。提交代码和运行结果截图。 #include <stdlib.h> #include <time.h> #include <stdio.h> #include <string.h> 阅读全文
posted @ 2022-11-10 10:04 HSJtl 阅读(4) 评论(0) 推荐(0) 编辑
 
 

公告


Powered by: 博客园
Copyright © 2023 HSJtl
Powered by .NET 7.0 on Kubernetes