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. |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started