Processor Management
Processor Management
Q.1 Define the terms: Program, Process.
Program: program is an inactive unit, such as
file stored on a disk. To an operating system, a program or job is a unit of
work that has been submitted by the user.
Process: process is an active entity that
requires a set of resource, including a processor and special registers, to
perform its functions. A process also called task.
Q.2 Explain the
role of a job scheduler and process scheduler.
-
Job scheduler also called as High level scheduler.
-
Job is initiated by the job scheduler.
-
It is only concerned with selecting jobs from a queue of
incoming jobs and placing them in the process queue based on each job’s characteristics
Process scheduler:
-
It determines which job will get the cpu, when and for how
long time. It also determines the job terminations.
-
It also decides when processing should be interrupted.
-
Process scheduler is also known
as Low level scheduler.
Q.3 what is
middle level scheduler?
In
a highly interactive environment there is also a third layer of the processor
manager called the middle level scheduler.
When system is overloaded middle-level scheduler activated; to remove
active jobs from memory to reduce the degrees of multiprogramming and thus
allows job to be completed faster.
Q.4 What are the five
states process can be in (Process Status)? Show how process changes states?
A process which have various States, the State of the
Process is also called as the Status of the process, The
Status includes whether the Process has Executed or Whether the process is
Waiting for Some input and output from the user and whether the Process is
Waiting for the CPU to Run the Program after the Completion
of the Process.
The various States of the Process are as
Followings:-
1) New State : When a user request
for a Service from the System , then the System will first initialize the
process or the System will call it an initial Process . So Every new Operation
which is Requested to the System is known as the New Born Process.
2) Running State : When the Process
is Running under the CPU, or When the Program is Executed by the CPU , then
this is called as the Running process and when a process is Running then this
will also provides us Some Outputs on the Screen.
3) Waiting : When a Process is
Waiting for Some Input and Output Operations then this is called as the Waiting
State. And in this process is not under the Execution instead the Process is
Stored out of Memory and when the user will provide the input then this will
Again be on ready State.
4) Ready State : When the Process is
Ready to Execute but he is waiting for the CPU to Execute then this is called
as the Ready State. After the Completion of the Input and outputs the Process
will be on Ready State means the Process will wait for the Processor
to Execute.
5) Terminated State : After the
Completion of the Process , the Process will be Automatically terminated by the
CPU . So this is also called as the Terminated State of the Process. After
Executing the Whole Process the Processor will Also deallocate the Memory which
is allocated to the Process. So this is called as the Terminated Process.
Q.6 Which are the various states of transitions
and what is the role of the job scheduler and process scheduler during these
transitions?
- Hold to ready – the
transition from hold to ready is initiated by the job scheduler according
to some predefined policy. At this point availability of enough main
memory and any requested devices are checked.
- READY to
RUNNING
- It is handled by the Process Scheduler using some predefined algorithm,
such as FCFS, SJN, priority scheduling, SRT or round robin, to determine
which process will get the CPU, when, and for how long.
- RUNNING
back to READY – It is handled by the Process Scheduler according to
some predefined time limit or other criterion, for example, priority
interrupts or quantum expired.
- RUNNING to
WAITING
– It is handled by the Process Scheduler and is initiated by an
instruction in the process such as a command to READ, WRITE or other I/O
requests, or a page fetch is required.
- WAITING to
READY
– It is handled by the Process Scheduler and is initiated by signal from
I/O device manager that I/O request has been satisfied and job can
continue.
- Running to
finished- the transition from running to finished is initiated
by the process scheduler or the job scheduler either when (1) the job is
successfully completed and it ends execution or (2) the operating system
indicates that an error has occurred and the job is being terminated
prematurely.
Q.7 What is a Process Control Block (PCB)? What information
about a job needs to be in a PCB? Or explain process control block in detail.
Process
Control block is used for storing the collection of
information about the Processes and this is also called as the Data Structure
which Stores the information about the process. The information of the Process
is used by the CPU at the Run time. The various information which is Stored
into the PCB are as followings
1-
process identification : each
job is uniquely identified by user’s identification,
when
the job 1st enters the sys., placed on HOLD.
2- process status : indicates
current status of job, HOLD,READY,RUNNING,WAITING.
3-
process state :
Process
status word-
when job is not running but is Either on HOLD or WAITING or READY .
Register
contents-
if the job has been interrupted , waiting to resume the processing.
Main
memory-including
the address where the job is stored (including mapping)
Resources- info. About
all resources allocated to that job.
process
priority: select
which job will be run next.
4-
Accounting : - performance measurement. Indicates what kind of
resources used & how long, for a job.
-
cpu time used , from start to end.
-
Total time spent for job.
-
How long the job stayed in memory.
-
Secondary story usage, sys. Prog. Usage (compilers,editors)
-
Usage of channels, CU ,devices.
-
No. of i/o records, read/written.
Q.8 Discuss the various criteria for a good process
scheduling policy.
Criteria to good scheduling policy :--
Maximize
throughput: run
as many jobs as possible in given amt. of time. This could be accomplished
easily by running only short jobs or by running jobs without interruptions.
Minimize
response time: This could be done by running only interactive jobs and
letting batch jobs wait until the interactive load cases.
Minimize
turnaround time: move entire jobs in and out of the system quickly.
This could be done by running all batch job first.
Minimize
waiting time: reducing the number of users allowed on the system so the
CPU would be available immediately.
Maximize
CPU efficiency: running only CPU bound jobs.
Ensure
fairness for all jobs: give everyone an equal amount of CPU and I/O time.
Q.9 Define the terms: Turnaround time, Response time, aging,
natural wait, nonpreemptive scheduling policy, preemptive scheduling policy.
Turnaround time: a measure of a system’s
efficiency that tract the time required to execute a job and return output to
the user.
Response time: a measure of the efficiency of an
interactive system that tracks the speed with which the system will respond to
a users command.
Aging: a policy used to ensure that jobs that have been in the
system for a long time in the lower level queues will eventually completed
their execution.
Natural wait: a common term used to identify an I/O
request from a program in a multiprogramming environment that would cause a
process to wait naturally before execution.
Context switching: the act of saving a jobs processing information
in its PCB so the job can be swapped out of memory and of loading the
processing information from the PCB of another job into the appropriate
registers so the CPU can process it. Context switching occurs in all preemptive
policies.
Nonpreemptive scheduling policy: A job
scheduling strategy that function without external interrupts so that once a
job captures the processor and begins execution, it remains in the running
state uninterrupted until issues an I/O request or its finished.
Preemptive scheduling policy: any process
scheduling strategy that based on predetermined policies, interrupts the
processing of a job and transfers the CPU to another job. It is widely used in
time sharing environments.
Q.10 Explain the concept of aging. When and why is it required?
Some systems
increase the priority of jobs that have been in the system for an unusually
long time to expedite their exit. This is known as aging. These criteria are
used to determine default priorities in many systems. The default priorities
can be overruled by specific priorities named by users.
Q.11 explain the terms CPU cycle time and waiting time. Also
explain the relation between them.
CPU Cycle time: CPU cycle time contains both the actual
CPU usage and the I\O request.
Waiting time: the difference between turn around time
and burst time.
Waiting
time=turn around time-burst time