Scheduling Flashcards

1
Q

What is scheduling?

A

Scheduling allows one process to use the CPU while the execution of another process is on hold (i.e. waiting state) due to unavailability of any resource like I/O etc (part of the process manager). It handles the removal of the running processes from the CPU and the selection fo another process. It is also responsible for multiplexing processes on the CPU. The scheduling algorithm will determine the order in which the OS will execute the processes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe the Schedular Organisation.

A

When a process is changed in the ready state, the enqueuer places a pointer to the process descriptor into a ready list. Context switcher saves the content of all processor registers of the process being removed into the process’ descriptor, whenever the scheduler switches the CPU from executing a process to executing anoter (voluntarily/involuntarily context switch). The dispatcher is invoked after the current process has been removed from the CPU.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Name the two types of Schedulers.

A

Cooperative scheduler (voluntary CPU sharing).
Preemptive scheduler (involuntary CPU sharing)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe the two scheduler types, Cooperative and Preemptive scheduling.

A

Cooperative - Each process will periodically invoke the process scheduler, voluntarily sharing the CPU. Each process should call a function that will implement the process scheduling. It allows much simpler implementation of applications because their execution is never unexpectedly interrupted by the process scheduler.

Preemptive - the interrupt sytem enforces periodic involuntary interruption of any process’s execution. It can force a process to involuntarily execute a yield type function. This is done by incorportating an interval timer device that produces an interrupt whenever the time expires. The interrupt handler will call the scheduler to reschedule the processor without any action on the part of the running process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the problem with cooperative scheduler?

A

One process could keep the CPU forever.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Name 2 strategies used to select the next running process.

A

Non-preemptive strategy and preemptive strategy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Describe what is meant by non-preemtptive selection strategies.

A

Allow any process to run to completion once it has been allocated te control of the CPU. A process that gets the control of the CPU, releases the CPU whenever it ends or when it voluntarily gives up the control of the CPU.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Describe what is meant by preemtptive selection strategies.

A

The highest priority process among all ready processes is allocated the CPU. All lower priority processes are made to yeild to the highest priority process whenever it requests the CPU. It allows for equitable resource sharing among processes at the expense of overloading the system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the follow shortened Scheduling Algorithms :
1. FCFS
2. SJF
3. SRTN
4. Time slice = ?
5. MLQ
6. MLQF

A
  1. First Come First Serve
  2. Shortest Job First
  3. Shortest Remaining TIme Next
  4. Round Robin
  5. Multiple Level Queue
  6. Multiple Level Queue with Feedback
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you calculate the Turnaround time?

A

Completion Time - Arrival Time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you calculate the Waiting time?

A

Turnaround Time - Burst Time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which of the following Algorithms are preemptive or non-preemptive? FCFS, SJF, SRJN, Time Slice

A

FCFS - non-preemptive
SJF - non-preemptive
SRTN - preemptive
Time Slice - preemptive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Explain what happens in the Time Slice Algorithm.

A

Each process gets a time slice of CPU time, distributing the processing time equitably among all processes requesting the processor. Whenever a time slice expires, the control of the CPU is given to the next process in the ready list. It is not well suited for long jobs, since the scheduler will be called multiple times until the job is done. It is very sensitive to the size of the time slice.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is Priority Based Scheduling? Is it preemptive or non-preemptive?

A

There are both preempitve and non-preemptive variants.
Each process has an externally assigned priority and every time an event occurs that generates a process switch, the process with the highest priority is chosen from the ready process list.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a problem, and the solution to that problem, with priority based scheduling?

A

Problem: The lower priority processes will never gain CPU time.
Solution: Use dynamic priorities so that the longer a process waits, the higher its priority is.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is MLQ and MLQF

A

Multiple Level Queue: Complex systems have requirements for real time, interactive users and batch jobs. Therefore, a combined scheduling mechanism should be used. The processes are divided into classes and each class has a process queue with a specific scheduling algorithm. Each process queue is treated accordingly to a queue scheduling algorithm.
Multiple Level Queue with Feedback is like MLQ but you can move between queues which makes it more efficient.