OS Part 4 (Scheduling) Flashcards
When are scheduling decisions made?
REQUIRED:
1. When a process exits.
2. When a process is blocked due to I/O (waiting for input).
EXPECTED:
1. When a new process is created.
2. When an I/O interrupt occurs.
3. When a clock interrupt occurs.
What factors are considered when a scheduling decision is made?
Whether or not the currently running process has ran for long enough. This can be based on whether the scheduling type is:
- Non-pre-emptive scheduling, where a process runs until it blocks or voluntarily gives up processing time.
- Pre-emptive scheduling, where a process runs until it reaches a set maximum time interval.
What is the general aim of all scheduling systems?
- Fair access to processor (all programs get a chance to run).
- Policy enforcement (processes deemed of higher importance/critical get access to CPU faster/wait less time)
- Balance (keeping all parts of the system busy is efficient)
What are the 3 specialised scheduling systems?
- Batch Systems
- Interactive Systems
- Real-Time Systems
What is the purpose of a “Batch System”?
- Maximise throughput (the amount of jobs being finished per second)
- Minimise turnaround (provide output as fast as possible)
- Maximise utilisation (keep system busy, but not if it compromises the above goals)
What is the purpose of an “Interactive System”?
- Optimise response time (foreground tasks the user is interested in are prioritised to increase perceived responsiveness).
- Proportionality (attempt to meet user’s expectations of how long each task should take)
What is the purpose of a “Real-Time System”?
- Meet deadlines (avoid losing time-critical data).
- Avoid quality degradation (ensure quality of data is kept as accurate and reliable as possible).
What are the main characteristics of a “Batch System”?
First Come, First Served:
1. Non-pre-emptive.
2. Processes are assigned to the CPU in order of request.
3. Single queue of ready processes.
4. First job runs until it blocks or terminates.
5. New jobs are put on the end of the current queue.
Advantages - Very simple and easy to implement.
Disadvantages - Computationally heavy processes dominate.
What are the main characteristics of an “Interactive System”?
Round-Robing Scheduling:
1. Pre-emptive.
2. Each process is assigned a time interval.
3. If still running at the end of its time-slot, suspend task and assign new task to CPU.
4. Maintain a list of ready/runnable processes, of which suspended processes are placed at the end.
What three priority systems can “Batch Systems” work off?
- First come, first served (Easier to implement, common example)
- Shortest job first (Generally more optimal and responsive)
- Shortest time remaining (I don’t know how much better this is)
What effects does changing the time allocation (quantum) for a process have on overall execution in “Interactive Systems”?
If the quantum is too short, CPU switches between tasks rapidly. Switching tasks comes with a slight processing overhead, so if switching happens too often, CPU resources are wasted.
If the quantum is too long, the CPU switches between tasks slower, making the overall system less responsive.
How can schedules be improved using priorities?
Allow parent processes to manage their children processes based on their own individual priorities.
This will create a tree-based structure of self-organising processes which have a better chance of being efficient whilst also allowing for effective use of round-robin techniques and preventing from compute heavy tasks from preventing responsiveness and causing I/O blocking.