Content-Length: 3102416 | pFad | https://www.scribd.com/presentation/672406584/Os-Process-Management

1 Os Process Management | PDF | Process (Computing) | Scheduling (Computing)
0% found this document useful (0 votes)
167 views25 pages

Os Process Management

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 25

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..

• Question:- Consider the system which has n


CPU processors and n processes then what is
the minimum and maximum number of
process that may present in the ready,
running and block state.
Inter process communication
• Inter-process communication (IPC) is a mechanism that allows processes
to communicate with each other and synchronize their actions.

• Process and Thread:


Process Thread

System calls involves in process System calls not involves in process

OS treats different process differently All user level thread treated as a


single task for OS
Different process have different It share same copies of code and data
copies of data, files.
It also takes more time for context It takes less time for context
switching. switching.
Thread
• A thread is a single sequential flow of execution
of tasks of a process so it is also known as thread
of execution or thread of control. It share the
same space memory of the process so context
switching of the thread very less than process
context switch.
Types of Threads
• Kernel level thread.
• User-level thread.
User-level thread

• The operating system does not recognize the user-level


thread. User threads can be easily implemented and it is
implemented by the user. If a user performs a user-level
thread blocking operation, the whole process is blocked. The
kernel level thread does not know nothing about the user
level thread.
• Mode bit is 1
Kernel level thread

• The kernel thread recognizes the operating system. There is a thread


control block and process control block in the system for each thread and
process in the kernel-level thread. The kernel-level thread is implemented
by the operating system. The kernel knows about all the threads and
manages them. The kernel-level thread offers a system call to create and
manage the threads from user-space. The implementation of kernel
threads is more difficult than the user thread. Context switch time is
longer in the kernel thread.
• Mode bit is 0
Times Related to the Process
• Arrival Time:- The time at which the process enters
into the ready queue is called the arrival time.
• Burst Time:- The total amount of time required by
the CPU to execute the whole process is called the
Burst Time.
• Completion Time:- The Time at which the process
enters into the completion state or the time at
which the process completes its execution, is called
completion time.
• Turnaround time:- The total amount of time spent by
the process from its arrival to its completion, is called
Turnaround time.
TAT=CT-AT
• Waiting Time:-The Total amount of time for which the
process waits for the CPU to be assigned is called
waiting time.
WT=TAT-BT
• Response Time:- The difference between the arrival
time and the time at which the process first gets the
CPU is called Response Time.
RT=FIRST RESPONSE-AT

You might also like









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://www.scribd.com/presentation/672406584/Os-Process-Management

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy