資源簡介
分頁式虛擬存儲系統是把作業信息的副本存放在磁盤上,當作業被選中時,可把作業的開始幾頁先裝入主存且啟動執行。為此,在為作業建立頁表時,應說明哪些頁已在主存,哪些頁尚未裝入主存,
代碼片段和文件信息
//?interrupt.cpp?:?Defines?the?entry?point?for?the?console?application.
//
#include?“stdafx.h“
#include?
#include?
#include?
//#pragma?comment(?linker?“/subsystem:\“windows\“?/entry:\“mainCRTStartup\““?)?//?設置入口地址
const?int?MAX_TASKS=100;
const?int?MAX_MEM=MAX_TASKS;
using?namespace?std;
struct?memory?
{
int?page;
int?sign?;
int?blockid;
string?diskid;
};
struct?task?
{
string?type;
int?page;
int?cell;
};
int?main(int?argc?char*?argv[])
{
int?memoryblock=0;
int?tasknum=0;
memory?MEM[MAX_MEM];
task?TASK[MAX_TASKS];
ifstream?ifile1ifile2;
ifile1.open(“memory.txt“);
string?a;
int?i=0;
memory?tmp;
while?(!ifile1.eof())
{
ifile1>>a;
switch(i)
{
case?0:
tmp.page=atoi(a.c_str());
break;
- 上一篇:斗地主的升級或洗牌c++程序
- 下一篇:算法分析與設計——統計數字問題
評論
共有 條評論