Lecture 11 Flashcards
Whats the objective of multi programming?
The objective of multiprogramming is to have some process running at all times, to maximize CPU utilization.
What’s the idea of multi-programming?
- Several processes are kept in memory at one time.
- When one process has to wait, the operating system takes the CPU away from that process and gives the CPU to another process.
What happens on a multi-core system?
On a multicore system, this concept of keeping the CPU busy is extended to all processing cores on the system.
What are the states of process execution?
Process execution consists of a cycle of CPU execution(CPU burst) and I/O wait(I/O burst)
How does a CPU schedular work?
- Whenever the CPU becomes idle, the CPU scheduler selects one of the processes in the ready queue to be executed.
- It then allocates the CPU to that process.
The records in the queues are generally ___________ of the processes.
Process Control Blocks
What are the four circumstances in which the CPU scheduling decisions take place?
- When a process switches from the running state to the waiting state
- When a process switches from the running state to the ready state
- When a process switches from the waiting state to the ready state
- When a process terminates
What’s a non-preemptive scheme?
Under non-preemptive scheduling, once the CPU has been allocated to a process, the process keeps the CPU until it releases it either by terminating or by switching to the waiting state.
Preemptive scheduling can result in ________ when data are shared among several processes.
race conditions
What is a dispatcher?
The dispatcher is a module that gives control of the CPU’s core to the process selected by the CPU scheduler.
What is dispatch latency?
The time it takes for the dispatcher to stop one process and start another running is known as the dispatch latency.
What functions are performed by a dispatcher?
This function involves the following:
1. Switching context from one process to another
2. Switching to user mode
3. Jumping to the proper location in the user program to resume that program
What are the criteria for comparing CPU- scheduling algorithms?
- CPU utilization(maximizing)
- Throughput(maximizing)
- Turnaround time(minimizing)
- Waiting time(minimizing)
- Response time(minimizing)
Discuss the FCFS algorithms of CPU scheduling.
Objective:
-The process that requests the CPU first is allocated the CPU first.
Implementation:
It is implemented with a FIFO queue.
1. When a process enters the ready queue, its PCB is linked to the tail of the queue.
2. When the CPU is free, it is allocated to the process at the head of the queue.
3. The running process is then removed from the queue.
What is the disadvantage of the FCFS policy?
The average waiting time under the FCFS policy is often quite long.