Download presentation
Presentation is loading. Please wait.
1
Chapter 3: Process-Concept
2
Chapter 3: Process-Concept
Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication in Client-Server Systems
3
Schedulers Scheduler: is a selection of a process from various scheduling queues Long-term scheduler (or job scheduler) – selects which processes should be brought into the ready queue (memory) Short-term scheduler (or CPU scheduler) – selects which process should be executed next and allocates CPU
4
Schedulers The primary distinction between them is:
Frequency of execution The short-term scheduler must select a new P for CPU frequently. A process may execute for only few milliseconds before waiting for I/O request. Often, short-term scheduler executes at least once every 100 milliseconds and takes about 10 milliseconds to decide to execute a new process. Then we could say that 10/(100+10)= 9% of the CPU time is being used for scheduling the work. (wasted time)
5
Schedulers The long term scheduler executes less frequently.
It controls the degree of multiprogramming (number of P in memory) Most processes can be described as either I/O bound or CPU bound. I/O bound process is one that spends more of its time doing I/O than doing computation. CPU bound process doing most of its time in computation than requesting I/O requests.
6
Schedulers So, it is important long-term scheduler select a good process mix of I/O-bound and CPU-bound processes to have a balance system. If all processes are I/O-bound: Ready queue will almost be empty Short-term scheduler will have little to do If all processes are CPU-bound: I/O waiting queue will almost be empty I/O device will be unused.
7
Medium-term scheduler
Some operating systems use medium-term scheduler or swapping. The idea: it removes P from memory and CPU ( swap out) and later p can be enter memory (swap in). So process is swapped out and later swapped in by the medium-term scheduler. Why medium-term scheduler may be necessary: Improve the processes mix A change in memory requirements (no enough memory)
8
Addition of Medium Term Scheduling
9
Schedulers (Cont) Short-term scheduler is invoked very frequently (milliseconds) (must be fast) Long-term scheduler is invoked very infrequently (seconds, minutes) (may be slow) The long-term scheduler controls the degree of multiprogramming Processes can be described as either: I/O-bound process – spends more time doing I/O than computations, many short CPU bursts CPU-bound process – spends more time doing computations; few very long CPU bursts
10
Context Switch When CPU switches to another process, the system must save the state of the old process and load the saved state for the new process via a context switch Context of a process represented in the PCB Context-switch time is overhead; the system does no useful work while switching Time dependent on hardware support
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.