• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/48

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

48 Cards in this Set

  • Front
  • Back

Define scheduling

The method by which threads, processes or data flows are given access to system resources.

3 transition states

1. Ready


2. Running


3. Waiting

Why a process makes a transition?

1. an action of the process


(non-preemptive scheduling)


2. occurrence of an external event


(preemptive scheduling)

When will a process be selected by the processor?

1. be in memory


2. Ready state


3. scheduled to be next

State transition diagram

3 process schedulers

1. (long term) deciding on which jobs or processes are to be admitted into the ready queue (main memory)


2. (medium term) the temporary removal of processes from main memory into secondary memory (hard disk) or vice versa


3. (short term) the actual CPU scheduler, that decides which of the ready, in memory processes are to be executed (allocated a CPU) next, following a clock interrupt, an IO interrupt, an operating system call or another form of signal

4 types of scheduling

1. long term scheduling


2. medium term scheduling


3. short term scheduling


4. IO scheduling

Define long term scheduling

the decision to add to the pool of processes to be executed

Define medium term scheduling

the decision to add to the number of processes that are partially or fully in main memory

Define short term scheduling

the decision as to which available process will be executed by the processor

Define IO scheduling

the decision as to which process's pending IO request shall be handled by an available IO device

Define Scheduler Dispatcher

the module that gives control of the CPU to the process selected by the short term dispatcher

what should the function involving the scheduler dispatcher do?

1. Switching context


2. Switching to user mode


3. Jumping to the proper location in the user program to restart the program

Define dispatch latency

the time it takes for the dispatcher to stop one process and start another

Scheduled vs Dispatcher

the scheduler picks process for the ready queue while the dispatcher is the modulenthay actually places the process on the processor.


there is a dispatcher for every processor on a system


Scheduling and Process State

new to ready/suspend is long term scheduling


ready/suspend to ready is medium term scheduling


ready to running is short term scheduling


blocked/suspend to ready is medium term scheduling

2 types of scheduling queue

1. Ready queue


2. device queue



what happens during queue?

a newly arrives process is put into the ready queue. processes wait in the ready queue for allocating the CPU. once the CPU is assigned a process then it will execute. when it executes something will happen:



1. process could issue an IO request and then it would be placed in the IO queue


2. process can create sub process and will wait for termination


3. forcibly removed from CPU due to interrupt and placed back in the ready queue


4. used too much time and put back in ready queue

processes are created under 4 conditions (long term scheduling)

1. new batch job


2. interactive logon


3. creation by OS to provide service


4. spawning by existing process

once a process is created to execute a program it is in which state?

new state

Primary objective of the job scheduler

provide a balance mix of jobs, such as IO bound and processor bound. It also controls the degree of multiprogramming.

what is the degree of multiprogramming?

if the degree of multiprogramming is stable then the average rate of process creation must be equal to the average departure rate of processes leaving the system.

which state changes does the medium term scheduler control?

1. Ready suspend to ready


2. Ready blocked to blocked


the ready suspend state involves swapping between?

main memory and mass storage

The medium term scheduling reduces what?

The degree of multiprogramming

Main objective of the short term scheduler?

increase system performance

short term scheduler changes which process state?

from ready to running

what is another name for the short term scheduler?

CPU scheduler

what does the CPU scheduler do?

1. selects the process among the processes that are ready to execute and allocates CPU to one of them


2. it executes most frequently and makes the fine grained decision of which process to execute next

when is the short term scheduler invoked?

1. when an event occurs that may lead to the blocking of the current process or that may provide an opportunity to preempt a current running process in favor of another

In addition to changing the state from ready to running, the short term scheduler also changes what states?

1. running to block for event wait


2. running to ready from time interrupts


3. blocked to ready as event occurs

comparing schedulers

long term = job scheduler


- controls degree of multiprogramming


- selects processes from the pool and loads them into memory for execution




short term = course scheduler


- less control over degree of programming


- chooses which program to execute




MED term = process swapping scheduler


- reduces the degree of multiprogramming


- re introduce the process into memory and execution can be continued


3 Process scheduling policies of the CPU scheduler

1. turnaround time - time between submission and completion of a process


2. response time - time from submission of a request until the response begins to be received


3. deadlines - maximize percentage of deadlines met

Define non preemptive

- once a process is in the running state, it will continue until it terminates or blocks itself for IO

Define preemptive

- currently running process may be interrupted and moved to ready state by the OS


- preemptive may occur when new process arrives, or on an interrupt

6 scheduling policies

1. first come first served


2. round robin


3. shortest process next


4. shortest remaining time


5. highest response ratio next


6. feedback

Define "shortest remaining time" scheduling policy

premptive


the one with the shortest remaining time left until completion is selected to be executed

Define "highest response ratio next" scheduling policy

non preemptive


dependant on estimated run time and also the amount of time it has spent waiting

Define "feedback" scheduling policy

if we have no indication of relative length then spn, srt, and hrrn can't be used. this one does not focus on time remain in to execute but focuses on time it has spent executing already

Preemptive or Non premptive

1. FCFS - nonpremptive


2. round robin - preemptive (at time quantum)


3. SPN- non preemptive


4. SRT - preemptive (at arrival)


5. HRRN - non preemptive


6. feedback - preemptive (at time quantum)

FCFS aka FIFO advantages

1. good for long processes


2. favor processing bound over IO bound processes


Scheduling Algorithm Goals

All systems


1. fairness


2. policy enforment


3. balance



Batch system


1. throughput


2. turnaround time


3. CPU utilization



Interactive system


1. response time


2. proportionality



real time system


1. meeting deadlines


2. predictability

what part of the goals is the scheduler concerned mainly with?

1. throughput - number of processes that complete their execution per time unit


2. latency -


turnaround - total time between submission of a process and completion


response time - time before request was submit and when the first response produced


3. fairness/waiting time

which scheduling policy for batch systems

1. first come first served


2. shortest job first


3. shortest remaining time next

Scheduling for interactive systems

1. round robin


2. priority scheduling


3. multiple queues


4. shortest process next

what is priority Scheduling?

CPU allocated to the process with the highest priority

problem with priority scheduling

Starvation

how to prevent starvation

aging. adds age factor which increases the priority