
操作系统
Puppet__
努力想变得更好
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
操作系统页面调度问题(这里只给出了FIFO、LRU、OPT) 纯c++数组模拟 略low
目前在上实验课,理论以后在进行补充。以下只放上纯模拟的代码。 其实模拟还是很好模拟的,三者仅仅只是发生缺页时调度方法不同,尤其是LRU和OPT两者代码只有一个地方不同,区别之处就在于LRU是向前找,而OPT算法则是向后找。以下以序列{2,3,2,1,5,2,4,5,3,2,5,2} 12个数为例。想要用户输入可以在主函数里写个输入,定义一个全局的数组长度即可。系统内存的块则用的数组b来代表,也可...原创 2018-10-16 20:37:21 · 674 阅读 · 0 评论 -
磁盘调度算法
#include <bits/stdc++.h> using namespace std; /* 假设当前磁头在67号,要求访问的磁道号顺序为98,25,63,97,56,51,55,55,6 */ int a[]= {98,25,63,97,56,51,55,55,6}; int citou = 67; void FIFO() { int ans = 0; in...原创 2018-10-30 20:28:11 · 417 阅读 · 0 评论 -
电话亭问题
#include <iostream> #include <algorithm> #include <cstdio> #include <cstring> #include <cmath> #include <windows.h> #include <io.h> #inc原创 2018-12-19 15:26:28 · 762 阅读 · 0 评论 -
叫醒睡着的理发师问题----操作系统
#include <iostream> #include <algorithm> #include <cstdio> #include <cstring> #include <cmath> #include <windows.h> #include <io.h> #include <conio.h&原创 2018-12-20 16:03:49 · 1366 阅读 · 2 评论 -
读者写者问题 代码
#include <iostream> #include <algorithm> #include <cstdio> #include <cstring> #include <cmath> #include <windows.h> #include <io.h> #include <conio.h&原创 2018-12-18 11:11:47 · 2984 阅读 · 1 评论