OperatingSystem
文章平均质量分 91
leon_wdbt
这个作者很懒,什么都没留下…
展开
-
Linux信号量的使用
实现代码#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <sys/types.h>#include <sys/ipc.h>#include <sys/sem.h>#include <sys/wait.h>static int set_semvalue(void);static int semaphore_p(void);s原创 2020-06-01 15:28:53 · 390 阅读 · 0 评论 -
Linux信号量和共享内存
实现代码#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <sys/types.h>#include <sys/ipc.h>#include <sys/shm.h>#include <sys/sem.h>#include <sys/wait.h>static int set_semvalue(void);stat原创 2020-06-01 15:28:40 · 479 阅读 · 0 评论 -
Linux消息队列运用
实现代码ex_msgrcv.c#include <stdlib.h>#include <stdio.h>#include <string.h>#include <errno.h>#include <unistd.h>#include <sys/msg.h>struct my_msg_st { long int my_msg_type; char some_text[BUFSIZ];};int ma原创 2020-06-01 15:28:22 · 231 阅读 · 0 评论 -
利用(循环队列)和(多线程编程)模拟实现打印作业任务管理
实现代码#include<stdio.h>#include<iostream>#include "Windows.h"int my_exit = 0;CRITICAL_SECTION my_printer; //创建临界区对象typedef int QElemType;#define MAXSIZE 3 typedef struct { QEl...原创 2020-04-25 18:04:17 · 2104 阅读 · 4 评论