Content-Length: 3102416 | pFad | https://www.scribd.com/presentation/672406584/Os-Process-Management
1Os Process Management
Os Process Management
Os Process Management
What is Process?
The program under execution is called as process.
It is two types.
Co-operative process:-The execution of one process affect or affected by
other process then those process are said to be co-operative process.
Independent process:- The execution of one process not affected by
other process then those process are said to be independent process.
What is Program?
A Program is an executable file which contains a certain set of instructions
written to complete the specific job or operation on your computer.
What is process management?
process management allows the operating system to control how
programs interact with each other.
Process Attribute
• Process id:- process id is the unique
identification number which is aligned by the
OS at the time process creation.
• Process state:- it contains current state
information of a process where it is residing.
• Program counter:- The program counter
contains the address of the next instruction to
be executed.
• Priority:- priority of a parameter assigned by the OS at
the time of process creation.
• General purpose register:- Every process has its own set
of registers which are used to hold the data which is
generated during the execution of the process..
• List of open files:- Every process uses some files which
need to be present in the main memory. OS also
maintains a list of open files in the PCB.
• List of open device:- OS also maintain the list of all open
devices which are used during the execution of the
process.
• Protection information:- OS also protect the stored files
in the memory.
Process State
• New state
• Ready state
• Running state
• Wait or block
• Termination or completion
• Suspend ready
• Suspend wait or suspend block
Operations on the Process
• Creation
• Schedule
• Dispatch
• Execution:- Once the process is scheduled for the
execution, the processor starts executing it.
• Killing or termination:- Once the purpose of the
process gets over then the OS will kill the process.
• Suspending
• Resuming
Process state diagram
Cont..
• Initially process will be in new state it means the process is under creation or
process is being created.
• Once the process is created it will be move on to ready state and in the ready
state multiple number of process.
• One of the process will be selected from the ready state and that will be
dispatch to the running state.
• When the process is in the running state it is occupy the CPU and executing the
instruction of the process and performing CPU time.
• In the running state there will be only one process at any point of time.
• If the running process require the input/output operation it will move on to wait
or block state.
• In the wait state also there is multiple number of process it means multiple
process will perform I/O operation simultaneously.
• When the resources is not sufficient to manage the process in ready state then
some of the process will be suspended and they will be move on to suspend
ready state.
What is Context ?
All the attribute of a process is called as context and it is stored in a
process control block(PCB).
What is PCB ?
Process Control Block is a data structure that contains information of the
process related to it. It is stored in the main memory and it is
implemented by double linked list.
What is context switching?
Whenever the running process requests some IO operation then the short
term scheduler saves the current context of the process (also called PCB)
and changes its state from running to waiting. During the time, process is
in waiting state; the Short term scheduler picks another process from the
ready queue and assigns the CPU to this process. This procedure is called
context switching.
Process scheduling
• The activity of determining which process in the
ready state should be moved to the running state is
known as Process Scheduling.
• The prime aim of the process scheduling system is:
1. To keep the CPU busy all the time and to
deliver
2. minimum response time for all programs.
3. For achieving this, the scheduler must apply
appropriate rules for swapping processes.
cont..
• Schedulers fall into one of the two general
categories:
• Non pre-emptive scheduling: When the
currently executing process gives up the CPU
voluntarily.
• Pre-emptive scheduling: When the operating
system decides to favor another process, pre-
empting the currently executing process.
Scheduler
• Schedulers are special system software which
handle process scheduling in various ways.
• Their main task is to select the jobs to be
submitted into the system and to decide which
process to run.
• Schedulers are of three types −
Long-Term Scheduler
Short-Term Scheduler
Medium-Term Scheduler
Long term scheduler
• It determines which processes are admitted to the system for
processing.
• Selects processes from pool (disk) and bring them into the ready
queue
• It selects processes from the queue and loads them into memory
for execution.
• When a process changes the state from new to ready, then there is
use of long-term scheduler.
• It controls Degree of Multiprogramming (DoM)
• DoM: The degree of multiprogramming describes the maximum
number of processes that a single-processor system can
accommodate efficiently.
Short term scheduler
• Short-term schedulers, also known as dispatchers.
• Selects which process should be executed next
among the processes and allocates CPU to one of
them.
• (From Ready Queue Selects one process for
execution and Allocate CPU (Running Queue))
• It must select process for CPU execution frequently.
• Short-term schedulers are faster than long-term
schedulers
Mid term scheduler
• Medium-term scheduling is a part of swapping.
• Reduces DOM(Degree of Multiprogramming)
• Processes are created and stored in Main Memory by Long
Term Scheduler, But these processes has to wait for their
turn to get execute.
• In Main Memory only those processes are kept that require
execution.
• When ready queue is empty, MTS Swap-In and Swap-Out
the processes from Main Memory and Secondary Memory.
• Ready + Running + Waiting Queues are in Main Memory
Dispatcher
• A dispatcher is a special program that comes
into play after the scheduler. When the short
term scheduler selects from the ready queue,
the Dispatcher performs the task of allocating
the selected process to the CPU.
Schedular vs Dispatcher
Schedular Dispatcher
The scheduler is special system software The Dispatcher is a module that controls
that handles process scheduling by the CPU to the process selected by the
selecting the process to execute. short term scheduler.
The scheduler works independently, and it There are no different types in Dispatcher,
works immediately when needed. and it is just a code segment.
Time taken by the scheduler is usually The time taken by the Dispatcher is called
negligible. dispatch latency.
The scheduler performs the task in three The Dispatcher allocates the CPU to the
stages, such as: The long-term scheduler process selected by the short-term
selects the process from the job queue scheduler.
and brings it to the ready queue.
The short term scheduler selects a
process in the ready queue.
The medium scheduler carries out the
swap in, swap out of the process.
Cont..
Process are categorise into two types
• CPU bound process:- The process which require more amount of CPU time
are called as CPU bound process.
• I/O bound process:- The process which require more amount of I/O time
are called as I/O bound process.
Cont..
Fetched URL: https://www.scribd.com/presentation/672406584/Os-Process-Management
Alternative Proxies: