Process Scheduling (Week 6) Flashcards
what is scheduling
The task of managing CPU sharing among a pool of ready processes/threads and is possible only with context switching facility.
what is a scheduler
The scheduler chooses one of the ready threads to allocate to the CPU when it is available.
what is a scheduling policy
The scheduling policy determines when it is time for a thread to be removed from the CPU and allocated to another thread.
what is a scheduling mechanism?
The scheduling mechanism determines how the process manager can determine it is time to interrupt the CPU, and how a thread can be allocated to and removed from the CPU.
how many logical parts is the scheduling mechanism composed of ?
3 logical parts
what are the 3 logical parts
enqueuer, dispatcher, and context switcher
what is the enqueuer
–> When a process/thread is changed into the ready state, the enqueuer enqueues the corresponding descriptor into a list of processes that are waiting for the CPU (or the ready list).
–> The enqueuer may place the new process anywhere in the list, depending on the scheduling policy.
what is the dispatcher
–> The dispatcher is invoked after the current process is removed from the CPU.
–> The dispatcher removes one of the threads from the ready list and then allocates it to the CPU by loading its CPU registers in the thread’s descriptor into the CPU.
what is the context switcher?
–> When the scheduler switches the CPU from executing one process to another, the context switcher saves the contents of all CPU registers (PC, IR, condition status, processor status, and ALU status) for the thread being removed into its descriptor.
_______ and ________ can have a
dramatic effect on the performance of a multiprogrammed computer.
Scheduler and its scheduling policy
how is the time take to finish a process by the processor determined
dependent on how often it gets to execute on the CPU as dispatched by the scheduler
what is the aim of the scheduler
–> decrease average time taken by a process to execute on the computer
–> increase the throughput of a computer in terms of the number of processes that get executed per unit time
what can a policy control
–> CPU utilization (busy and not kept idle)
–> Avg time a process waits for a service (reduce the time)
–> avg amount of time to complete a job (reduce the time)
what is the wait time W(pi)
W(pi) = Total time Pi spent waiting in the ready list (wait time)
Waiting time is defined as the total time which a process spends waiting for the CPU in the ready list.
what is the turnaround time [T trnd(pi)]
Let T trnd(pi) = Time from pi first enter ready to last exit ready (turnaround time)
Turnaround time is the time from the arrival of the process to its completion by the CPU. This includes the time it spent waiting for the CPU
what are the 2 types of schedulers
preemptive
non-preemptive
what are non - preemptive schedulers
when a process gets the CPU it will not be interrupted or cut short (pre-empted). It will have the oppourtunity to fully complete before the CPU is given to the next process.
types of non preemptive schedulers
First-Come-First-Served (FCFS)
Shortest Job First (SJF) (Non preemptive)
Priority (PR) (Non preemptive)
what are preemptive schedulers
the process take turns to share the CPU and they can be interrupted midway and the CPU can be allocated to another process before the process can finish
what are the types of Preemptive (involuntary) Schedulers
Shortest Job First (SJF) (Preemptive)
Priority (PR) (Preemptive)
Round Robin (RR)
Multi-level Queues
what is the first come first serve scheduling algorithm
Scheduler picks up first job to arrive in the
ready list.
advantage of first come first serve scheduling algorithm
Simplest CPU scheduling algorithm