操作系统课程设计进程管理系统.docx
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《操作系统课程设计进程管理系统.docx》由会员分享,可在线阅读,更多相关《操作系统课程设计进程管理系统.docx(18页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、操作系统课程设计报告题目:专业:班级:姓名:学号:指导老师:queuenode * p;while (front!=NULL)(p=front;front=front-link;delete p;)void queue:enqueue (char &item)if(front=NULL)front=rear=new queuenode (item, NULL);else rear=rear-link=new queuenode (item, NULL);)char queue:dequeue()queuenode *p=front;char f=p-data;front=front-link;
2、delete p;return f;)void queue:display()queuenode *p;p=front;while (p!=NULL) coutdata/z;p=p-link;cout/zNULL/z;queue:find (char item) queuenode *w;w=front;M: while(w!=NULL)if (item=w-data) return 1;break;)else w=w-link;goto M;)if(w=NULL) return 0;void queue:del ( char item) queuenode *q,*b;q=front;whi
3、le (q-data!=item)b=q;q=q-link;if(q=front) front=front-link; delete q;else if(q=rear) rear=b;rear-link=NULL;delete q; elseb-link=q-link; delete q;void main()int n;char a;cout,n操作系统之进程治理模拟系统(先来先效劳算法)n/zendl;queue execute, ready, clog; 执行,就绪,阻塞cout,n请用户输入进程名及其到达cpu的顺序(结束进程数请输Ax) nz,endl;char r; r=x; fo
4、r(int i=0;i+) char e100;cout输入进程名:ei;if (ei !=r)ready, enqueue (ei);elsebreak;)A: coutz/n 请(学号)用户(姓名)选择操作八n;cout/zn K执行进程2、将阻塞队列中进程调入就绪队列n;cout/zn 3、封锁进程4、结束进程nz,;coutn;if (n=l)if(!execute, isempty (). Oa已经有进程在执行!,此操作不能执行n;char w;cOutendl;cout如果要继续请输入#;如果要退出按其它任意键endl;coutw;if (w二二#) goto L;else got
5、o E;)else(if (!ready, isempty()a=ready. dequeue ();if (a!=r)execute, enqueue(a);goto L;else goto L;)else if(n=2)if (!clog, isempty ()a=clog. dequeue ();if (a!=r)ready, enqueue(a);goto L;)else goto L;else if (n-3)if(!execute, isempty ()(a=execute.dequeue ();if (a!=r)clog.enqueue(a);goto L;else goto L
6、;else if(n=4)(coutn请输入要结束的进程名:; cina;if (execute, find (a) | | ready, find (a)if(execute, find (a)execute, del (a) ;)else if(ready, find(a)ready, del (a) ;if (clog, find (a)clog, del (a) ;cout/zn 结束进程成功! nendl;goto L;elsecout 没有此进程n endl;goto L;if (n=l|n=21|n=31|n=4)(cout 执行队列endl;execute, display (
7、);coutendl;cout就绪队列 “endl;ready, display ();coutendl;cout 阻塞队列 ff endl;clog.display ();coutendl;goto A;elseif (n=5);elsen你的输入错误! n;gtoAcoutNULL请学号)用户姓名选择操作一一1、执行进程2、将阻塞队列中进程调久就绪队列3、封锁进程3、封锁进程心结束进程15、退出程序.选项:2执行队列a-NULL就绪队列!b-c-de - f-NUI.L阻塞队列ML请学号用户姓名)选择操作口、执行进程2、将阻塞队列中进程调入就绪队列I3,封锁进程*结束进程I5、退出程序丁一
8、;,一 一一一.:二:丁 选项,3执行队列鞫ULL就绪队列h-c-d-c-f-NULL阻塞以列a-HULL请学号用户姓名?选择操作J1、执行进程 2、将阻塞队列中进程调入就绪队列J3.封锁进程4.结束进程二二二,77.16、退出程序3选项:4 ,输入要结束的进程名:d 串进程成功!自行队列NULL就绪队列b-c-e-f-NULL坦塞队列aAHULL请学号用户姓名)选择操作人执行进程几将阻塞队列中进程调入就绪队列.封锁进程A结束进程,6 .退出程序选项:5Press any key to continue五、用户使用说明用户通过VC+即可运行改程序.需说明的是主函数是实现进程治理的入 口,在入口
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 操作系统 课程设计 进程 管理 系统
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内