Unit-Iv-Ssos-Notes BU
Unit-Iv-Ssos-Notes BU
Unit –IV
Virtual Storage: Virtual Storage Management Strategies – Page Replacement Strategies – Working
Sets – Demand Paging – Page Size. Processor Management: Job and Processor Scheduling:
Preemptive Vs Non-preemptive scheduling – Priorities – Deadline scheduling.
VIRTUAL STORAGE
Virtual storage management strategies
There are three main strategies namely
Fetch strategies – concerned with when a page or segment should be brought from secondary
to primary storage
Placement strategies – concerned with where in primary storage to place an incoming page or
segment
Replacement strategies – concerned with deciding which page or segment to displace to make
room for an incoming page or segment when primary storage is already fully committed
Page size
There is no single best page size. The designers of the Operating system will decide the
page
size for an existing machine. Page sizes are usually be in powers of two, ranging from 28 to 212
bytes or words. The size of the pages will affect in the following way.
a) Decreasing the page size increases the number of pages and hence the size of the page
table.
b) Memory is utilized better with smaller pages.
c) For reducing the I/O time we need to have smaller page size.
d) To minimize the number of page faults, we need to have a large page size
PROCESSOR MANAGEMENT:
Introduction:
When one or more process is runnable, the operating system must decide which oneto run
first. The part of the operating system that makes decision is called the Scheduler; the algorithm
it uses is called the Scheduling Algorithm.
An operating system has three main CPU schedulers namely the long term scheduler,
short term scheduler and medium term schedulers. The long term scheduler determines which
jobs are admitted to the system for processing. It selects jobs from the job pool and loads them
into memory for execution. The short term scheduler selects from among the jobs in memory
which are ready to execute and allocated the cpu to one of them. The medium term scheduler
helps to remove processes from main memory and from the active contention for the cpu and
thus reduce the degree of multiprogramming.
The cpu scheduler has another component called as dispatcher. It is the module that
actually gives control of the cpu to the process selected by the short term scheduler which
involves loading of registers of the process, switching to user mode and jumping to the proper
location.
Preemptive Vs Non-Preemptive
The Strategy of allowing processes that are logically runnable to be temporarily
suspended is called Preemptive Scheduling. ie., a scheduling discipline is preemptive if the CPU
can be taken away. Preemptive algorithms are driven by the notion of prioritized computation.
The process with the highest priority should always be the one currently using the processor. If a
process is currently using the processor and a new process with a higher priority enters, the ready
list, the process on the processor should be removed and returned the ready list until it is once
again the highest-priority process in the system.
Run to completion is also called Nonpreemptive Scheduling. ie., a scheduling discipline
is nonpreemptive if, once a process has been given the CPU, the CPU cannot be taken away from
that process. In short, Non-preemptive algorithms are designed so that once a process enters the
running state(is allowed a process), it is not removed from the processor until it has completed its
service time ( or it explicitly yields the processor). This leads to race condition and necessitates
of semaphores, monitors, messages or some other sophisticated method for preventing them. On
the other hand, a policy of letting a process run as long as it is wanted would mean that some
process computing π to a billion places could deny service to all other processes
indefinitely.
Deadline scheduling
Certain jobs have to be completed in specified time and hence to be scheduled based on
deadline. If delivered in time, the jobs will be having high value and otherwise the jobs will be
having nil value. The deadline scheduling is complex for the following reasons
a) Giving resource requirements of the job in advance is difficult
b) A deadline job should be run without degrading other deadline jobs
c) In the event of arriving new jobs, it is very difficult to carefully plan resource requirements
d) Resource management for deadline scheduling is really an overhead