{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Assignment 3

Operating Systems Principles

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CPSC435 (W2008) Operating Systems Answer Key for Assignment 3 1. Given the following information: Job Number Arrival Time CPU Time J1 0 10 J2 1 2 J3 2 3 J4 3 1 Draw A Gantt Chart ( i.e. timeline) for each of the following scheduling algorithms. a. FCFS b. SJF c. SRT J1 J2 J3 J4 0 1 2 3 10 12 15 J4 16 J1 J2 J3 J1 J2 J3 J4 0 1 2 3 10 11 13 16 J4 J2 J3 J1 J1 J2 J3 J4 0 1 2 3 4 7 16 J1 J2 J2 J4 J3 J1
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
d. Round Robin with a time quantum of 2 (you may ignore context switching time) case 1: J3 is put in the queue before J1 case 2: J1 is put in the queue before J3 2. Determine the turnaround time and waiting time for each of the jobs shown in the following Gantt chart. TAT J1 = 20 – 0 = 20 W J1 = (10 - 5) + (18 – 13) = 10 TAT J2 = 18 – 1 = 17 W J2 = (6 – 1) + (17 – 10) = 12 TAT J3 = 6 – 3 = 3 W J3 = (5 – 3) = 2 TAT J4 = 17 – 4 = 13 W J4 = (13 – 4) = 9 J1 J2 J3 J4 0 1 2 3 4 6 8 9 10 12 14 16 J1 J2 J3 J1 J4 J3 J1 J1 J1 J1 J2 J3 J4 0 1 2 3 4 6 8 9 11 12 14
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 16 J1 J2 J1 J3 J4 J1 J3 J1 J1 J1 J2 J3 J4 1 4 5 6 10 13 17 18 20 2 3 J1 J3 J2 J1 J4 J2 J1 2 3. Given the following timeline: Determine the priority (P) at t = 2 for processes P1 and P2 shown above for each of the following scheduling algorithms. ( Hint : use the approach shown on pp. 155-156 in the textbook). Note P1 arrives at t = 2 and P2 arrives at t = 1. We assume P2 gets the CPU immediately upon its arrival at t = 1. a. FCFS P(P1) = r P1 = 0 – 0 = 0 P(P2) = r P2 = (2 – 1) = 1 b. SJF P(P1) = -t P1 = -(4 – 2) = -2 P(P2) = -t P2 = -(6 – 1) = -5 c. SRT P(P1) = -(t P1 – a P1 ) = -(4 – 2) = -2 P(P2) = -(t P2 – a P2 ) = -(6 – 2) = -4 3 1 2 3 4 5 6 7 P1 P2...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern