Processes/Process Scheduling Algorithms Flashcards
What is a process
A process is an instance of a program in execution. It is an executing program.
Mention Process Management Functions:
PTC - P - DIS - PIM
Process creation
Termination
Controlling the progress of the process
Process
Dispatching
Interrupt handling
Switching between the process
Process synchronization
Inter process communication support
Management of process control blocks
Mention and describe the process states
The new state: The process is being created
The running state : The process is executing on the CPU
The blocked state: A process that is waiting for something to complete e.g I/O
The ready state: A process that is ready to be executed, but not currently assigned to a CPU
The terminated state: The process has finished execution.
What does a PCB contain?
PCC - MAI
Process state
Program counter
CPU registers
CPU scheduling information
Memory management information
Accounting information
I/O status information.
What does the program counter do.
It indicates the address of the next instruction to be executed for this program.
Mention and describe the types of context switch
Simple Mode Switch: to process an interrupt without switching process
Full Process Switch: Process is suspended and another process will get the CPU
Mention Process Scheduling Queues
Job queue
Ready queue.
Device queues.
What is a job queue
Set of all processes in the system
What is a job queue
Set of all processes in the system
What is a ready queue
Set of all process residing in main memory, ready and waiting to execute
What is a device queue
What is a device queue
Set of processes waiting for an I/O device. Each device has its own device queue.
What is a device queue
Set of processes waiting for an I/O device. Each device has its own device queue.
Types of schedulers
Long term schedulers
Short term schedulers
Describe the schdulers
Long term scheduler: Also known as the job scheduler it selects which process should be brought into the ready queue.
Short term scheduler - Also known as CPU scheduler: Selects which process should be executed next and allocates CPU.
What is a medium term scheduler
Is used to remove processes from memory and reduce the degree of multiprogramming
Process can be described as either?
I/O bound process - Spends more time doing I/O than computations
CPU-bound process - spends more time doing computations;
What is a dispatcher
An OS program that switches the CPU from one process to another selected by the short term scheduler.
Functions of a dispatcher
It prevents a single process from monopolizing the CPU
It decides who goes next according to a scheduling algorithm.
What is dispatch latency
It is the time it takes for the dispatcher to stop one process and start another
When does a process get terminated
Batch jobs issues
User logs off
Process executes a service request to terminate
Error or fault conditions.
What are the scheduling critieria
MAX CPU utilization - keeps the cpu as busy as possible
MAX Throughput - # of processes that complete their execution per unit time
MIN Turnaround time - Amount of time to execute a particular time
MIN Waiting time - Amount of time a process has been waiting in the ready queue.
MIN Response time. - Amount of time it takes from when a request was submitted until the first response is produced, not output
What are the CPU scheduling algorithms
First-come First Served(FCFS) Scheduling
Shortest Job First
Priority Scheduling
Round Robin
Multilevel Queue