Question: 3. (d). A processor can only execute one instruction in one-unit time. However, a task can take more than one unit of time to complete.
| 3. | (d). | A processor can only execute one instruction in one-unit time. However, a task can take more than one unit of time to complete. For example, the task of opening a Chrome (browser) window could take up three-unit time. A computer usually needs to run tasks concurrently. Hence, task scheduling is very important. Task scheduling in computer is implemented on a first-come, first served basis. Table 1 listed six tasks that await to be executed within 15-unit time along with their execution time and arrival time. Note that the time unit starts with t0.
| |
| (i). | Infer how can queue be used to simulate the above scenario and what are the output once the simulation of 15-unit time runs out. | ||
| 3. | (d). | (ii). | Construct class TaskType that implement Task as and ADT. |
| 3. | (d). | (iii). | Write the member function definition set_waiting_time of class TaskType in question 3 (d) (iii). This function calculates the waiting time for each task in the queue based on Table 1. |
Task ID T1 T2 T3 T4 T5 T6 Table 1 Execution Time 3 unit time 5 unit time 2 unit time 4 unit time 6 unit time 1 unit time Arrival Time to t1 t3 t6 t10 t14 The timeline of task arrival time for Table 1 is illustrated in Figure 3. to t1 T1 T2 t2 ts t4 T3 Arrival Time to t6 17 ts to 110 111 112 113 114 T4 T5 TO Task Figure 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts

