Operating System/O.S(Neso Academy, HPC Lab. KOREATECH)

11)Preemptive Scheduling , Scheduling Criteria , FCFS(First-Come, First-Served) Scheduling

Tony Lim 2021. 5. 11. 21:33

CPU Scheduler 

the scheduler selects a process from the processes in memory that are ready to execute and allocates the CPU to that process

Dispatcher

module that gives actual control of the CPU to the process selected by the scheduler.

dispatch latency = time it takes for the dispatcher to stop one process an dstart another process.

 

CPU- scheduling decisions may take place under the following 4 circumstances

  1. running state to waiting state (I/O event)
  2. running state to ready state (interrupt occurs)
  3. waiting state to ready state  (completion of I/O)
  4. when a process terminate

In 1,4 situation decision are not needed , if new process exists it will be selected for execution. == non preemptive

In 2,3 situation == preemptive , CPU can be taken away and give it to another process.

 

Scheduling Criteria

we want to maximize CPU utilization.

Throughput = number of process that are completed per time unit, called throughput.

Turnaround time = sum of the periods spen waiting to get into memory , waiting in the ready queue, executing on the cpu, and doing I/O  == The time period from submitting the process to entire completion.

Waiting time = sum of the periods spent waiting in the ready queue. == CPU Scheduler only affect this time. not execution time or I/O.

Response time = time from the submission of a request unti the first response is produced.

 

FCFS Scheduling

Process that request the CPU first is allocated the CPU first.

if CPU burst times vary greatly , average waiting time might not be minimal.

Non preemptive