{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Dale - Computer Science Illuminated 363

Dale - Computer Science Illuminated 363 - CPU it keeps it...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Turnaround time The CPU scheduling metric that measures the elapsed time between a process’s arrival in the ready state and its ulti- mate completion 336 Chapter 10 Operating Systems p1 p2 p3 p4 p5 0 140 215 535 815 940 Scheduling algorithms are often evaluated using particular metrics, such as the turnaround time for a process. This is the amount of time between the time a process arrives in the ready state to the time it exits the running state for the last time. We would like, on average, for the turnaround time for our processes to be small. There are various approaches that can be used to determine which process gets chosen first to move from the ready state to the running state. We examine three of them in the next sections. First-Come, First-Served In first-come, first-served (FCFS) scheduling approach, processes are moved to the CPU in the order in which they arrive in the running state. FCFS scheduling is nonpreemptive. Once a process is given access to the
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CPU, it keeps it unless it makes a request that forces it to wait, such as a request for a device in use by another process. Suppose processes p1 through p5 arrive in the ready state at essentially the same time (to make our calculations simple) but in the following order and with the specified service time: In the FCFS scheduling approach, each process receives access to the CPU in turn. For simplicity, we assume here that processes don’t cause themselves to wait. The following Gantt chart shows the order and time of process completion: Since we are assuming the processes all arrived at the same time, the turnaround time for each process is the same as its completion time. The average turnaround time is (140 + 215 + 535 + 815 + 940) / 5 or 529. Process p1 p2 p3 p4 p5 Service time 140 75 320 280 125...
View Full Document

{[ snackBarMessage ]}