Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

8.. Assume we have five tasks, T1, T2, T3, T4, and T5 with priorities: 3, 9, 5,

ID: 3590949 • Letter: 8

Question

8.. Assume we have five tasks, T1, T2, T3, T4, and T5 with priorities: 3, 9, 5, 2, and 3 respectively. (Priority is on a scale of 1 – 10 with 1 being the highest and 10 the lowest). Assume these 5 tasks are ready for execution at: 20 sec, 15 sec, 15 sec, 45 sec and 50 sec respectively after the processor starts. Further assume the total execution times of the tasks respectively are 30, 15, 20, 25 and 20 seconds each. Assuming a time slice value of 5 seconds, and preemptive priority based scheduling with round robin time slicing answer the following questions:

Select all answers that are correct regarding the execution of task 1 and 5:

A) Task 5 starts executing at t=70 secs and stops execution at t = 75 secs as it gets preempted by task 1.

B) Task 1 starts executing at t=20 secs and stops execution at t = 45 secs as it gets preempted by task 4.

C) Task 1 starts executing at t=20 secs and stops execution at t = 50 due to completion

D) Task 1 resumes execution at t=75 secs and stops execution at t = 80 due to task completion

E) Task 5 resumes execution at t=80 secs and stops execution at t = 95 secs due to task completion.

F) Task 1 resumes execution at t=70 secs and stops execution at t = 75 due to task completion

Explanation / Answer

Hi,
Given five tasks, T1, T2, T3, T4, and T5 with priorities: 3, 9, 5, 2, and 3
since we are using round robin scheduling, where time slice is 5 sec, which means every 5 sec window is split between the processes.
given tasks arrive at 20 sec, 15 sec, 15 sec, 45 sec and 50 sec, now,
one ambigous thing in this question is, if priorities are equal either of the tasks can be chosen at random, that needs to be mentioned
A) Task 5 starts executing at t=70 secs and stops execution at t = 75 secs as it gets preempted by task 1.
FALSE, since T1 and T5 have same priority it wont be preempted(this really depends on implementation though)

B) Task 1 starts executing at t=20 secs and stops execution at t = 45 secs as it gets preempted by task 4.
True, since T1 is the highest priority task till T4 arrives, it keeps executing till 45 seconds, at which T4 and arrives and it is preempted
C) Task 1 starts executing at t=20 secs and stops execution at t = 50 due to completion
Since B is true, this cannot be true.
D) Task 1 resumes execution at t=75 secs and stops execution at t = 80 due to task completion
FALSE, sicne F is true
E) Task 5 resumes execution at t=80 secs and stops execution at t = 95 secs due to task completion.
TRUE, now thast T1 is done, T5 is the highest priority process and keeps executing until finish
F) Task 1 resumes execution at t=70 secs and stops execution at t = 75 due to task completion
TRUE, since it stops at 45, only 5 seconds of job is left, anf since T4 started at 45, it finished at 70(45+25), hence T1 starts and finished at T=80
Thumbs up if this was helpful, otherwise let me know in comments

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote