資源簡介
這是一個(gè) 操作系統(tǒng)進(jìn)程管理模擬系統(tǒng) ,是我根據(jù)一位網(wǎng)友的作品修改后的穩(wěn)定版,其實(shí)現(xiàn)了進(jìn)程的管理(阻塞、運(yùn)行、等待、完成,采用優(yōu)先服務(wù)的方式)和內(nèi)存的分配(最佳適配法),功能比較完善,感興趣的朋友可以拿去看看,還望多多指教。
代碼片段和文件信息
//?process.cpp?:?Defines?the?entry?point?for?the?console?application.
//
#include?“stdafx.h“
#include?“stdio.h“
#include?“stdlib.h“
#include?“string.h“
#include?“iostream.h“
#include??//要用到格式控制符
//定義“空”
#define?null?0
//定義不再切割的剩余分區(qū)大小
#define?size?5
//定義內(nèi)存總量大小
#define?memory_totalsize?100
//定義時(shí)間片
#define??TIME_PIECE?2
//定義優(yōu)先級(jí)減少的數(shù)量
#define?PRIORITY?0
//定義進(jìn)程結(jié)構(gòu)體
struct?process
{
char?name[40];//進(jìn)程名字
float?memory_need;//進(jìn)程所需內(nèi)存
char?state[10];?//進(jìn)程狀態(tài)?
int?priorty;??//優(yōu)先級(jí)
int?alltime;??//總共所需運(yùn)行時(shí)間
int?cputime;??//該進(jìn)程在CPU中運(yùn)行的總時(shí)間
struct?process?*next;//指向下一個(gè)進(jìn)程
}*process_ready?*process_blocked?*process_e;//將正在執(zhí)行的進(jìn)程設(shè)置為一全局變量
//定義內(nèi)存分配結(jié)構(gòu)體
struct?memory_allocation
{
struct?memory_allocation?*forward;//指向前一個(gè)空間
char?process_name[40];//進(jìn)程名
float?start_address;//進(jìn)程開始地址
float?memory_size;//進(jìn)程占用內(nèi)存大小
int?state;//內(nèi)存占用狀態(tài)
struct?memory_allocation?*after;//指向后一個(gè)空間
}*free_chain;
//occupy_chain備用
//*occupy_chain
void?process_excute();
void
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件?????451584??2008-11-13?18:16??操作系統(tǒng)進(jìn)程管理模擬\Debug\process.bsc
?????文件?????225356??2008-11-13?18:16??操作系統(tǒng)進(jìn)程管理模擬\Debug\process.exe
?????文件?????309336??2008-11-13?18:16??操作系統(tǒng)進(jìn)程管理模擬\Debug\process.ilk
?????文件??????52644??2008-11-13?18:16??操作系統(tǒng)進(jìn)程管理模擬\Debug\process.obj
?????文件?????203896??2008-11-12?22:47??操作系統(tǒng)進(jìn)程管理模擬\Debug\process.pch
?????文件?????582656??2008-11-13?18:16??操作系統(tǒng)進(jìn)程管理模擬\Debug\process.pdb
?????文件??????????0??2008-11-13?18:16??操作系統(tǒng)進(jìn)程管理模擬\Debug\process.sbr
?????文件???????2261??2008-11-12?22:47??操作系統(tǒng)進(jìn)程管理模擬\Debug\StdAfx.obj
?????文件???????4073??2008-11-12?22:47??操作系統(tǒng)進(jìn)程管理模擬\Debug\StdAfx.sbr
?????文件??????91136??2008-11-13?18:16??操作系統(tǒng)進(jìn)程管理模擬\Debug\vc60.idb
?????文件?????118784??2008-11-13?18:16??操作系統(tǒng)進(jìn)程管理模擬\Debug\vc60.pdb
?????文件??????29677??2008-11-13?18:16??操作系統(tǒng)進(jìn)程管理模擬\process.cpp
?????文件???????4552??2008-11-12?23:08??操作系統(tǒng)進(jìn)程管理模擬\process.dsp
?????文件????????539??2008-11-12?22:44??操作系統(tǒng)進(jìn)程管理模擬\process.dsw
?????文件??????50176??2008-11-13?18:17??操作系統(tǒng)進(jìn)程管理模擬\process.ncb
?????文件??????48640??2008-11-13?18:17??操作系統(tǒng)進(jìn)程管理模擬\process.opt
?????文件???????2076??2008-11-13?18:16??操作系統(tǒng)進(jìn)程管理模擬\process.plg
?????文件???????2506??2008-11-13?18:22??操作系統(tǒng)進(jìn)程管理模擬\ReadMe.txt
?????文件????????294??2008-11-12?22:44??操作系統(tǒng)進(jìn)程管理模擬\StdAfx.cpp
?????文件????????769??2008-11-12?22:44??操作系統(tǒng)進(jìn)程管理模擬\StdAfx.h
?????目錄??????????0??2008-11-13?18:16??操作系統(tǒng)進(jìn)程管理模擬\Debug
?????目錄??????????0??2008-11-13?18:17??操作系統(tǒng)進(jìn)程管理模擬
-----------?---------??----------?-----??----
??????????????2180955????????????????????22
評(píng)論
共有 條評(píng)論