鱼C论坛

 找回密码
 立即注册
查看: 4195|回复: 1

急求答案~~~~

[复制链接]
发表于 2012-10-11 14:57:30 | 显示全部楼层 |阅读模式
1鱼币
[b]
1)假设内存最多可调入5个进程,即就绪队列中的进程数最多有5个。分别编写进程的创建、运行、阻塞、唤醒、终止等函数,在main函数中通过命令调用各函数,实现进程状态的转换。
2)至少应包含3各队列,就绪队列、阻塞队列和完成队列,并且各队列随着进程的状态转换而呈动态变化,应能在屏幕上显示出队列的变换情况。此三个队列可用数据结构中的链表、队列或数组来实现。
3)实验结果可显示的部分内容如下(仅供参考)。
Comand button :
-----------------------------------------------------------------
C—create a new process
P--Process to CPU to execute
B--execute to block
W--process return to ready linklist
E –current process has been finished
-----------------------------------------------------------------
Press C button to create process
input cname: 1
Now creat a new process [1]:
Now ready linklist is: ->1
……………………..
input cname:2
Now creat a new process [2]:
Now ready linklist is: ->2->1
………………………
input cname: 3
Now creat a new process [3]:
Now ready linklist is: ->3->2->1
……………………….
input cname: 4
Now creat a new process [4]:
Now ready linklist is: ->4->3->2->1
……………………….
Press P button to execute process
input pname: 4
Now the process [4] want to poccess CPU:
The process [4] is executing in CPU now!
Now ready linklist is: ->3->2->1
……………………..
input pname: 3
Now the process [4] want to poccess CPU:
There is a process unfinished,please wait for a moment!
……………………..
Press B button to block current process
Now the block linklist is: ->4
The process [4] want another device except CPU,
CPU can execute another process now.
………………………
Press P button to execute process
input pname: 3
Now the process [3] want to poccess CPU:
The process [3] is executing in CPU now!
Now ready linklist is: ->2->1
………………………..
Press E button to finish current process
Now the process [3] has been finished,
CPU can execute another process!
………………………..
Press W button to wake up process
Input wname: 4
The process [4] want to return ready linklist
Now the ready linklist is: ->4->2->1
[/b]

小甲鱼最新课程 -> https://ilovefishc.com
发表于 2012-10-11 15:27:43 | 显示全部楼层
坐等牛人                        
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-11-15 12:02

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表