- 博客(4)
- 收藏
- 关注
原创 操作系统实验:windows下C++实现生产者/消费者问题
生产者/消费者问题#include <windows.h>#include <iostream>const unsigned short SIZE_OF_BUFFER = 2; //缓冲区长度unsigned short ProductID = 0; //产品号unsigned short ConsumeID = 0; //将被消耗的产品号unsigned short in = 0; //产品
2021-06-24 09:58:19 1992
原创 操作系统实验:windows下C++实现读者/写者问题
读者/写者问题#include <windows.h>#include <iostream>bool P_continue = true; // 控制程序结束HANDLE X_semaphore; // 用于读互斥HANDLE wsem; // 用于写互斥DWORD WINAPI Reader(LPVOID); // 读者线程DWORD WINAPI Writer(LPVOID); // 写者线程int readcount;//读
2021-06-24 09:54:47 1239
原创 操作系统实验:简单 shell 命令行解释器的设计与实现
操作系统实验:简单 shell 命令行解释器的设计与实现#include <stdio.h>#include <unistd.h>#include <string.h>//help方法void help(){ char str[100]; scanf("%s", str); if(strcmp("help", str) == 0){ printf("cd <目录>更改当前的工作目录到另一个<目录>\n"); printf
2021-06-21 20:59:58 1888 6
原创 操作系统实验:磁盘调度算法模拟(FIFO,SSTF,SCAN,C-SCAN)
磁盘调度算法模拟(FIFO,SSTF,SCAN,C-SCAN)1.都是从磁道号为100开始。2.其中SCAN和C-SCAN都是让他们从离100较近的方向开始的。#include <stdio.h>#include <math.h>#include <stdlib.h>//先进先出void FIFO(int a[], int n){ int i; int sum = 0, num; for (i = 0; i < n - 2; i++)
2021-06-19 15:47:59 1500
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人