鱼C论坛

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

急求答案,求大神指导

[复制链接]
发表于 2012-10-11 14:55:15 | 显示全部楼层 |阅读模式
1鱼币
处理机调度与死锁(一)
题目如下:
作业名称
到达时间
服务时间
静态优先权
A
0
8
9
B
1
9
4
C
2
4
7
D
3
2
2
E
4
6
9
其中静态优先权中的“0”代表最高优先权,数值越大,优先权越低。要求编程实现以上调度算法,给出作业执行顺序,求解出作业的周转时间、平均周转时间、带权周转时间和平均带权周转时间。
3.实验环境
不限。Turbo C,VC++,Java均可。
4.实验提示(仅供参考)
1)复习各算法原理,明确作业的周转时间、平均周转时间、带权周转时间和平均带权周转时间的求解公式,即:
周转时间=完成时间-到达时间
平均周转时间=各作业周转时间的和/作业数
带权周转时间=周转时间/服务时间
平均带权周转时间=各作业带权周转时间的和/作业数
at-到达时间;bt-开始时间;st-服务时间;ft-完成时间;tt-周转时间
2)编程的数据结构,可定义为多个数组,也可定义成结构体数组:
typedef struct{ char name;       //作业名称
                    int at,bt,st,ft,tt;   
                    float wtt,priority;
wtt-带权周转时间;priority-优先权
                }sequenlist p[N];
预先输入各作业的已知条件,即nameatst(对于静态优先权算法,还要输入priority),按不同调度算法求解作业执行顺序和ttwtt
3)实验结果可显示的部分内容如下(仅供参考)。
The order of calling way:
---------------------------
[F]--First come first serve
[S]--Short Job First
[P]--Static priority
[G]--Great respond percent
---------------------------
If you pressFkey
* *You select [FCFS]:
=============================================
Name  Atime  Stime  Btime  Ftime  Ttime  WTtime
  A     0      8      0      8      8    1.000000
  B     1      9      8     17     16    1.777778
  C     2      4     17     21     19    4.750000
  D     3      2     21     23     20    10.000000
  E     4      6     23     29     25    4.166667
----------------------------------------------------------------------------
The order of Job ExecutionA-B-C-D-E
The average of [Turn time] is:20.439999
The average of [Turn time with weight] is:4.870000
If you pressPkey
* *You select [Static Priority]:
=====================================================
Name  Atime  Stime  Priority    Btime  Ftime  Ttime  WTtime
  A     0      8    9.000000     0      8      8    1.000000
  B     1      9    4.000000    10     19     18    2.000000
  C     2      4    7.000000    19     23     21    5.250000
  D     3      2    2.000000     8     10      7    3.500000
  E     4      6    9.000000    23     29     25    4.166667
-----------------------------------------------------------------------------------------
The order of Job ExecutionA-D-B-C-E
The average of [Turn time] is:20.177601
The average of [Turn time with weight] is:4.049244

小甲鱼最新课程 -> https://ilovefishc.com
发表于 2012-10-11 15:28:56 | 显示全部楼层
还没研究系统                             
小甲鱼最新课程 -> 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.

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