• 沒有找到結果。

852020.10.23 22:03

N/A
N/A
Protected

Academic year: 2021

Share "852020.10.23 22:03"

Copied!
6
0
0

加載中.... (立即查看全文)

全文

(1)

第 5 章作业( CPU…

答题版本 2020.10.23 22:03 试卷得分

85

图像.jpeg 简答题 (15 分) 3分

答案解释:

1. The following processes are being scheduled using apreemptive, roundrobin scheduling algorithm.

Process          Priority          Burst      Arrival P1        40         20           0 P2        30         25           25 P3        30         25           30 P4        35         15           60 P5        5         10           100 P6        10         10           105

Each process is assigned a numerical priority,with ahigher number indicating a higher  relative priority. In addition to the processes listed below, the system also has an idle task (which consumes no CPU resources and is identified as Pidle). This task has priority 0 and is scheduled whenever the system has no other available processes to run.

The length of a time quantum is 10 units. If a process ispreempted by a higher-priority process, the preempted process is placed at theend of the queue.

a. Show the scheduling order of the processes using a Gantt chart.

b. What is the turnaround time for each process?

c. What is the waiting time for each process?

d. What is the CPU utilization rate?

(2)

图像 2.jpeg 简答题 (15 分) 12分

答案解释:

2. Consider the following set of processes,with the length of the CPU-burst time given in milliseconds:

Process      Burst Time     Priority

P1         10         3

P2         1             1

P3         2         3

P4         1         4

P5         5         2

The processes are assumed to have arrivedin the order P1, P2, P3, P4, P5,all attime 0.

a. Draw four Gantt charts illustrating the execution of these processes using FCFS, SJF, a nonpreemptive priority (a smaller priority number implies a higher priority),and RR (quantum= 1) scheduling.

b. What is the turnaround time of each process for each of the scheduling algorithms in part a?

c. What is the waiting time of each processfor each of the scheduling algorithms in part a?

d. Which of the schedules in part a results in the minimal average waiting time (over all processes)?

(3)

A.

B.

C.

D.

多选题 (8 分) 8分

正确答案: B D

3. Which of the following scheduling algorithms could result in starvation?

First-come, first-served Shortest job first Round robin Priority

填空题 (12 分) 12 分 (请按题⽬中的空缺顺序依次填写答案)

(1) 26

(2) 8

(3) 14

正确答案: (1) 26 (2) 8 (3) 14

4.  Usingt he Windows XP scheduling algorithm, what is the numeric priority of a thread for the following scenarios?

a. A thread in the REALTIME PRIORITYCLASSwith a relative priority of HIGHEST.______

b. A thread in the NORMAL PRIORITY CLASSwith a relative priority of NORMAL.______

c.A thread in the HIGH PRIORITY CLASS with a relative priority of ABOVE NORMAL.______

A.

B.

C.

D.

单选题 (5 分) 5分

正确答案: C

5. whenround-robin(RR) scheduling algorithm is used to allocate the CPU to eachprocess and a running state process uses up a time quantum, the state of thatrunning process will become ____.

Waiting Running Ready Terminated

A.

B.

C.

单选题 (5 分) 5分

6. A measure of the number ofprocesses completed per time unit is called?

Throughput Waiting time Response time

(4)

D.

正确答案: A CPU utilization

A.

B.

C.

D.

单选题 (5 分) 5分

正确答案: B

7. One of the problems with priority scheduling is ____ .

aging starvation process death average waiting time

A.

B.

C.

D.

单选题 (5 分) 5分

正确答案: C

8. Suppose 4 processes arrive atthe same time and the average execution time of every process is 2 hours. Ifthey run on a CPU one by one, then the average turnaround time is ____.

1 hour 2.5 hours 5 hours 8 hours

A.

B.

C.

D.

单选题 (5 分) 5分

正确答案: C

9. Why the Shortest-Job-Firstprocess scheduling cannot be implemented?

It is too complex

It requires special hardware

The length of the next CPU burst is not known The length of the next I/O burst is notknown

A.

B.

C.

D.

单选题 (5 分) 5分

10. The best process schedulingalgorithm in terms of average waiting time is ____ ?

FCFS Priority Round-Robin SJF/SPF

(5)

正确答案: D

A.

B.

C.

D.

单选题 (5 分) 5分

正确答案: A

11. Among CPU scheduling policies,First Come First Serve (FCFS) is attractive because ____.

 it is simple to implement

 it minimizes the total waiting time in the system it minimizes the average waiting time inthe system it minimizes the average response time in the system

A.

B.

C.

D.

单选题 (5 分) 5分

正确答案: D

12. 下列进程调度算法中,综合考虑进程等待时间和执⾏时间的是?

时间⽚轮转调度算法 短进程优先调度算法 先来先服务调度算法

⾼响应⽐优先调度算法

A.

B.

C.

D.

单选题 (5 分) 5分

正确答案: A

13. 下列选项中,降低进程优先级的合理时机是?

进程的时间⽚⽤完

进程刚完成I/O,进⼊就绪队列 进程长期处于就绪队列中 进程从就绪态转为运⾏态

A.

B.

C.

D.

单选题 (5 分) 5分

14. 下列选项中,满⾜短任务优先且不会发⽣饥饿现象的调度算法是?

先来先服务

⾼响应⽐优先 时间⽚轮转

⾮抢占式短任务优先

(6)

正确答案: B

參考文獻

相關文件

Mie–Gr¨uneisen equa- tion of state (1), we want to use an Eulerian formulation of the equations as in the form described in (2), and to employ a state-of-the-art shock capturing

• Uses a nested structure to accumulate path data as the simulation is running. • Uses a multiple branch structure to choose the

The continuity of learning that is produced by the second type of transfer, transfer of principles, is dependent upon mastery of the structure of the subject matter …in order for a

* All rights reserved, Tei-Wei Kuo, National Taiwan University, 2005..

The remaining positions contain //the rest of the original array elements //the rest of the original array elements.

When an algorithm contains a recursive call to itself, we can often describe its running time by a recurrenceequation or recurrence, which describes the overall running time on

ƒ Preemptive scheduling – CPU scheduling is invoked whenever a process arrives at the ready queue, or the running process relinquishes the CPU.. ƒ Non-preemptive scheduling – CPU

ƒ Preemptive scheduling – CPU scheduling is invoked whenever a process arrives at the ready queue, or the running process relinquishes the CPU.. ƒ Non-preemptive scheduling – CPU