CSC4320/6320 Quiz2 Name:_______________________ Question1: Explain the following terminology: 1. Preemptive Scheduling and Non-preemptive Scheduling (10%) 2. Dispatch latency (5%) 3. Turnaround time, waiting time, and response time (15%) Under non-preemptive scheduling, once the CPU has been allocated to a process, the process keep the CPU until it release the CPU either by terminating or by switching to waiting state. Dispatch latency – time it takes for the dispatcher to stop one process and start another running Turnaround time – amount of time to execute a particular process Waiting time – amount of time a process has been waiting in the ready queue Response time – amount of time it takes from when a request was submitted until the first response is produced Question 2: 2.1 By “Shortest Job first non-preemptive” scheduling algorithm, draw the CPU scheduling Gantt chart and complete the table for the give processes information. (20%) Processes P1 P2 P3 P4 Burst time 3 2 1 5 Arrival time 0.0 0.0 2.0 4.0 Gantt chart: P1 P2 P3 P4 Waiting time Turnaround time Response time 2.2 By “Priority preemptive” scheduling algorithm, draw the CPU scheduling Gantt chart and complete the table for the give processes information. (20%) Processes P1 P2 P3 P4 Burst time 4 2 1 5 Arrival time 0.0 2.0 4.0 6.0 Priority (lower number indicates higher priority) 4 2 1 3 Gantt chart: P1 Waiting time Turnaround time Response time P2 P3 P4 Question 3: By “Multilevel Queue Fixed priority” scheduling algorithm, draw the CPU scheduling Gantt chart and complete the table for the give processes information. (30%) Process Burst time Algorithm P1 P2 P3 53 17 42 (RR interval:20) Background P4 P5 30 20 (FCFS) Foreground Gantt chart: P1 Waiting time Turnaround time Response time P2 P3 P4 P5