Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

(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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Information Modeling And Relational Databases

Authors: Terry Halpin, Tony Morgan

2nd Edition

0123735688, 978-0123735683

More Books

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago