SlideShare a Scribd company logo
3
Most read
8
Most read
10
Most read
Process & It’s States
Process :
Defination: A process is basically a program in execution.
The execution of a process must progress in a sequential fashion. Or
A process is defined as an entity which represents the basic unit of work to be
implemented in the system.
Process States:
Basically, A process necessarily goes through minimum 4 states.
1. New state
2. Ready state
3. Run state and
4. terminate or Exit state.
Process & It’s States Conti….
Following diagram shows the different states of process.
Process & It’s States Conti…
1. New State-
 A process is said to be in new state when a program present in the secondary memory
is initiated for execution.
2. Ready State-
 A process moves from new state to ready state after it is loaded into the main
memory and is ready for execution.
In ready state, the process waits for its execution by the processor.
In multiprogramming environment, many processes may be present in the ready state.
3. Run State-
 A process moves from ready state to run state after it is assigned the CPU for
execution.
4. Terminate State-
 A process moves from run state to terminate state after its execution is completed.
After entering the terminate state, context (PCB) of the process is deleted by the
operating system.
Process & It’s States Conti…
5. Block Or Wait State-
 A process moves from run state to block or wait state if it requires an I/O operation
or some blocked resource during its execution.
After the I/O operation gets completed or resource becomes available, the process
moves to the ready state.
6. Suspend Ready State-
 A process moves from ready state to suspend ready state if a process with higher
priority has to be executed but the main memory is full.
Moving a process with lower priority from ready state to suspend ready state creates a
room for higher priority process in the ready state.
The process remains in the suspend ready state until the main memory becomes
available.
When main memory becomes available, the process is brought back to the ready state.
6. Suspend Wait State-
 A process moves from wait state to suspend wait state if a process with higher
priority has to be executed but the main memory is full.
Process & It’s States Conti…
Moving a process with lower priority from wait state to suspend wait state creates a
room for higher priority process in the ready state.
After the resource becomes available, the process is moved to the suspend ready state.
After main memory becomes available, the process is moved to the ready state.
State Present in Memory
New state Secondary Memory
Ready state Main Memory
Run state Main Memory
Wait state Main Memory
Suspend wait state Secondary Memory
Suspend ready state Secondary Memory
Terminate state –
Process & It’s States Conti….
 Example: we write our computer programs in a text file and when we execute this
program, it becomes a process which performs all the tasks mentioned in the
program.
 When a program is loaded into the memory and it becomes a process, it can be
divided into four sections ─ stack, heap, text and data.
 The following image shows a simplified layout of a process inside main memory −
1. Stack
The process Stack contains the temporary data such as method/function parameters,
return address and local variables.
2. Heap
This is dynamically allocated memory to a process during its
run time.
3. Text
This includes the current activity represented by the value of Program Counter and the
contents of the processor's registers.
4.Data
This section contains the global and static variables.
Process & It’s States Conti…
Operations on the Process
1. Creation
Once the process is created, it will be ready and come into the ready queue (main
memory) and will be ready for the execution.
2. Scheduling
Out of the many processes present in the ready queue, the Operating system chooses
one process and start executing it.
 Selecting the process which is to be executed next, is known as scheduling.
3. Execution
Once the process is scheduled for the execution, the processor starts executing it.
Process may come to the blocked or wait state during the execution then in that case
the processor starts executing the other processes.
4. Deletion/killing
Once the purpose of the process gets over then the OS will kill the process.
 The Context of the process (PCB) will be deleted and the process gets terminated by
the Operating system.
Thread in Operating System
What is a Thread?
A thread is a path of execution within a process. A process can contain multiple
threads. Or
A thread is the subset of a process and is also known as the lightweight process. Or
A thread is a single sequential flow of execution of tasks of a process.
A process can have more than one thread, and these threads are managed
independently by the scheduler.
All the threads within one process are interrelated to each other.
Threads have some common information, such as data segment, code segment, files,
etc., that is shared to their peer threads.
But contains its own registers, stack, and counter.
Thread in Operating System
Thread in Operating System
How does thread work?
As we have discussed that a thread is a subprocess or an execution unit within a
process.
A process can contain a single thread to multiple threads.
A thread works as follows:
When a process starts, OS assigns the memory and resources to it.
 Each thread within a process shares the memory and resources of that process only.
Threads are mainly used to improve the processing of an application.
 In reality, only a single thread is executed at a time, but due to fast context switching
between threads gives an illusion that threads are running parallelly.
If a single thread executes in a process, it is known as a single-threaded And if
multiple threads execute simultaneously, then it is known as multithreading.
Need of Threads
A thread is also called a lightweight process. Threads provide a way to improve
application performance through parallelism. Threads represent a software approach to
improving performance of operating system by reducing the overhead thread is
equivalent to a classical process.
Thread in Operating System
Why Multithreading?
The idea is to achieve parallelism by dividing a process into multiple threads. For
example, in a browser, multiple tabs can be different threads. MS Word uses multiple
threads: one thread to format the text, another thread to process inputs, etc.
Types of Threads
1. User Level Thread
As the name suggests, the user-level threads are only managed by users, and the
kernel does not have its information.
These are faster, easy to create and manage.
The kernel takes all these threads as a single process and handles them as one process
only.
The user-level threads are implemented by user-level libraries, not by the system calls.
2. Kernel-Level Thread
The kernel-level threads are handled by the Operating system and managed by its
kernel.
These threads are slower than user-level threads because context information is
managed by the kernel. To create and implement a kernel-level thread, we need to make
a system call.
Thread in Operating System
Thread in Operating System
Comparison
Basis
Process Thread
Definition
A process is a program under
execution i.e an active
program.
A thread is a lightweight process
that can be managed
independently by a scheduler.
Context
switching time
Processes require more time
for context switching as they
are more heavy.
Threads require less time for
context switching as they are
lighter than processes.
Memory
Sharing
Processes are totally
independent and don’t share
memory.
A thread may share some
memory with its peer threads.
Communication
Communication between
processes requires more time
than between threads.
Communication between threads
requires less time than between
processes .
Blocked
If a process gets blocked,
remaining processes can
continue execution.
If a user level thread gets
blocked, all of its peer threads
also get blocked.
Thread in Operating System
Comparison
Basis
Process Thread
Resource
Consumption
Processes require more
resources than threads.
Threads generally need less
resources than processes.
Dependency
Individual processes are
independent of each other.
Threads are parts of a process and
so are dependent.
Data and Code
sharing
Processes have independent
data and code segments.
A thread shares the data segment,
code segment, files etc. with its peer
threads.
Treatment by OS
All the different processes are
treated separately by the
operating system.
All user level peer threads are
treated as a single task by the
operating system.
Time for creation
Processes require more time for
creation.
Threads require less time for
creation.
Time for
termination
Processes require more time for
termination.
Threads require less time for
termination.

More Related Content

PDF
operating system structure
PPTX
Dead Lock in operating system
PPT
4. system models
PPTX
Inter Process Communication
PPTX
INTER PROCESS COMMUNICATION (IPC).pptx
PPT
Deadlock
PPTX
2. Distributed Systems Hardware & Software concepts
operating system structure
Dead Lock in operating system
4. system models
Inter Process Communication
INTER PROCESS COMMUNICATION (IPC).pptx
Deadlock
2. Distributed Systems Hardware & Software concepts

What's hot (20)

PPTX
Context model
PPTX
Application layer
PPTX
Operating system 11 system calls
PPTX
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
PPT
Memory Management in OS
PPTX
Parallel computing and its applications
PPT
Services provided by os
PPTX
file system in operating system
PPTX
Presentation on Operating System & its Components
PPTX
Cpu scheduling in operating System.
PDF
Real Time Systems
PPTX
Directory structure
PPT
Communications is distributed systems
PPTX
Segmentation in Operating Systems.
PPTX
Process management os concept
PPTX
OS multiprocessing -.pptx
PPT
Paging.ppt
PPTX
Introduction to parallel processing
PPTX
Concurrency control
PPTX
Need for Web Engineering
Context model
Application layer
Operating system 11 system calls
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Memory Management in OS
Parallel computing and its applications
Services provided by os
file system in operating system
Presentation on Operating System & its Components
Cpu scheduling in operating System.
Real Time Systems
Directory structure
Communications is distributed systems
Segmentation in Operating Systems.
Process management os concept
OS multiprocessing -.pptx
Paging.ppt
Introduction to parallel processing
Concurrency control
Need for Web Engineering
Ad

Similar to Process & Thread Management (20)

PPTX
UNIT 2 OS.pptx Introduction of Operating System
PPTX
Chapter -2 operating system presentation
PPTX
2 Process and Thread_java20231123-3.pptx
PPTX
Process and thread Management Operating system
PPTX
Chapter 3 chapter reading task
PPTX
Process, Threads, Symmetric Multiprocessing and Microkernels in Operating System
PDF
OPERATING SYSTEMS and types of operating system
PPTX
Operating Systems Process Management.pptx
PPTX
Chapter two process.pptx
PPT
PDF
Lecture 2- Processes.pdf
PPTX
Operating Systems chap 2_updated2.pptx
PPTX
operating system process management with example
PPTX
OS - Chapter # 3 for the development of os
PPTX
Operating System Process Scheduling.pptx
PDF
Comprehensive Introduction to Operating Systems and Their Functions
PPTX
Processes, Threads.pptx
PPTX
Processes, Threads.pptx
UNIT 2 OS.pptx Introduction of Operating System
Chapter -2 operating system presentation
2 Process and Thread_java20231123-3.pptx
Process and thread Management Operating system
Chapter 3 chapter reading task
Process, Threads, Symmetric Multiprocessing and Microkernels in Operating System
OPERATING SYSTEMS and types of operating system
Operating Systems Process Management.pptx
Chapter two process.pptx
Lecture 2- Processes.pdf
Operating Systems chap 2_updated2.pptx
operating system process management with example
OS - Chapter # 3 for the development of os
Operating System Process Scheduling.pptx
Comprehensive Introduction to Operating Systems and Their Functions
Processes, Threads.pptx
Processes, Threads.pptx
Ad

More from Vpmv (11)

PPT
Operating System.ppt
PDF
Classification of Computers.pdf
PDF
Basic Components of Computer....pdf
PDF
Algorithm & Flowchart.pdf
PDF
Evolution or Generation of OS.pdf
PDF
Introduction of OS & Classification of Software
PPTX
Case, Loop & Command line args un Unix
PPTX
FILE PERMISSION OR ACCESS MODE
PPTX
Directory Management in Unix
PPTX
Stucture of c program
PPT
Network topology
Operating System.ppt
Classification of Computers.pdf
Basic Components of Computer....pdf
Algorithm & Flowchart.pdf
Evolution or Generation of OS.pdf
Introduction of OS & Classification of Software
Case, Loop & Command line args un Unix
FILE PERMISSION OR ACCESS MODE
Directory Management in Unix
Stucture of c program
Network topology

Recently uploaded (20)

PDF
Updated Idioms and Phrasal Verbs in English subject
PDF
Classroom Observation Tools for Teachers
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
History, Philosophy and sociology of education (1).pptx
PDF
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Updated Idioms and Phrasal Verbs in English subject
Classroom Observation Tools for Teachers
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Supply Chain Operations Speaking Notes -ICLT Program
History, Philosophy and sociology of education (1).pptx
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
Complications of Minimal Access Surgery at WLH
Microbial diseases, their pathogenesis and prophylaxis
What if we spent less time fighting change, and more time building what’s rig...
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
LDMMIA Reiki Yoga Finals Review Spring Summer
STATICS OF THE RIGID BODIES Hibbelers.pdf
Chinmaya Tiranga quiz Grand Finale.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3

Process & Thread Management

  • 1. Process & It’s States Process : Defination: A process is basically a program in execution. The execution of a process must progress in a sequential fashion. Or A process is defined as an entity which represents the basic unit of work to be implemented in the system. Process States: Basically, A process necessarily goes through minimum 4 states. 1. New state 2. Ready state 3. Run state and 4. terminate or Exit state.
  • 2. Process & It’s States Conti…. Following diagram shows the different states of process.
  • 3. Process & It’s States Conti… 1. New State-  A process is said to be in new state when a program present in the secondary memory is initiated for execution. 2. Ready State-  A process moves from new state to ready state after it is loaded into the main memory and is ready for execution. In ready state, the process waits for its execution by the processor. In multiprogramming environment, many processes may be present in the ready state. 3. Run State-  A process moves from ready state to run state after it is assigned the CPU for execution. 4. Terminate State-  A process moves from run state to terminate state after its execution is completed. After entering the terminate state, context (PCB) of the process is deleted by the operating system.
  • 4. Process & It’s States Conti… 5. Block Or Wait State-  A process moves from run state to block or wait state if it requires an I/O operation or some blocked resource during its execution. After the I/O operation gets completed or resource becomes available, the process moves to the ready state. 6. Suspend Ready State-  A process moves from ready state to suspend ready state if a process with higher priority has to be executed but the main memory is full. Moving a process with lower priority from ready state to suspend ready state creates a room for higher priority process in the ready state. The process remains in the suspend ready state until the main memory becomes available. When main memory becomes available, the process is brought back to the ready state. 6. Suspend Wait State-  A process moves from wait state to suspend wait state if a process with higher priority has to be executed but the main memory is full.
  • 5. Process & It’s States Conti… Moving a process with lower priority from wait state to suspend wait state creates a room for higher priority process in the ready state. After the resource becomes available, the process is moved to the suspend ready state. After main memory becomes available, the process is moved to the ready state. State Present in Memory New state Secondary Memory Ready state Main Memory Run state Main Memory Wait state Main Memory Suspend wait state Secondary Memory Suspend ready state Secondary Memory Terminate state –
  • 6. Process & It’s States Conti….  Example: we write our computer programs in a text file and when we execute this program, it becomes a process which performs all the tasks mentioned in the program.  When a program is loaded into the memory and it becomes a process, it can be divided into four sections ─ stack, heap, text and data.  The following image shows a simplified layout of a process inside main memory − 1. Stack The process Stack contains the temporary data such as method/function parameters, return address and local variables. 2. Heap This is dynamically allocated memory to a process during its run time. 3. Text This includes the current activity represented by the value of Program Counter and the contents of the processor's registers. 4.Data This section contains the global and static variables.
  • 7. Process & It’s States Conti… Operations on the Process 1. Creation Once the process is created, it will be ready and come into the ready queue (main memory) and will be ready for the execution. 2. Scheduling Out of the many processes present in the ready queue, the Operating system chooses one process and start executing it.  Selecting the process which is to be executed next, is known as scheduling. 3. Execution Once the process is scheduled for the execution, the processor starts executing it. Process may come to the blocked or wait state during the execution then in that case the processor starts executing the other processes. 4. Deletion/killing Once the purpose of the process gets over then the OS will kill the process.  The Context of the process (PCB) will be deleted and the process gets terminated by the Operating system.
  • 8. Thread in Operating System What is a Thread? A thread is a path of execution within a process. A process can contain multiple threads. Or A thread is the subset of a process and is also known as the lightweight process. Or A thread is a single sequential flow of execution of tasks of a process. A process can have more than one thread, and these threads are managed independently by the scheduler. All the threads within one process are interrelated to each other. Threads have some common information, such as data segment, code segment, files, etc., that is shared to their peer threads. But contains its own registers, stack, and counter.
  • 10. Thread in Operating System How does thread work? As we have discussed that a thread is a subprocess or an execution unit within a process. A process can contain a single thread to multiple threads. A thread works as follows: When a process starts, OS assigns the memory and resources to it.  Each thread within a process shares the memory and resources of that process only. Threads are mainly used to improve the processing of an application.  In reality, only a single thread is executed at a time, but due to fast context switching between threads gives an illusion that threads are running parallelly. If a single thread executes in a process, it is known as a single-threaded And if multiple threads execute simultaneously, then it is known as multithreading. Need of Threads A thread is also called a lightweight process. Threads provide a way to improve application performance through parallelism. Threads represent a software approach to improving performance of operating system by reducing the overhead thread is equivalent to a classical process.
  • 11. Thread in Operating System Why Multithreading? The idea is to achieve parallelism by dividing a process into multiple threads. For example, in a browser, multiple tabs can be different threads. MS Word uses multiple threads: one thread to format the text, another thread to process inputs, etc. Types of Threads 1. User Level Thread As the name suggests, the user-level threads are only managed by users, and the kernel does not have its information. These are faster, easy to create and manage. The kernel takes all these threads as a single process and handles them as one process only. The user-level threads are implemented by user-level libraries, not by the system calls. 2. Kernel-Level Thread The kernel-level threads are handled by the Operating system and managed by its kernel. These threads are slower than user-level threads because context information is managed by the kernel. To create and implement a kernel-level thread, we need to make a system call.
  • 13. Thread in Operating System Comparison Basis Process Thread Definition A process is a program under execution i.e an active program. A thread is a lightweight process that can be managed independently by a scheduler. Context switching time Processes require more time for context switching as they are more heavy. Threads require less time for context switching as they are lighter than processes. Memory Sharing Processes are totally independent and don’t share memory. A thread may share some memory with its peer threads. Communication Communication between processes requires more time than between threads. Communication between threads requires less time than between processes . Blocked If a process gets blocked, remaining processes can continue execution. If a user level thread gets blocked, all of its peer threads also get blocked.
  • 14. Thread in Operating System Comparison Basis Process Thread Resource Consumption Processes require more resources than threads. Threads generally need less resources than processes. Dependency Individual processes are independent of each other. Threads are parts of a process and so are dependent. Data and Code sharing Processes have independent data and code segments. A thread shares the data segment, code segment, files etc. with its peer threads. Treatment by OS All the different processes are treated separately by the operating system. All user level peer threads are treated as a single task by the operating system. Time for creation Processes require more time for creation. Threads require less time for creation. Time for termination Processes require more time for termination. Threads require less time for termination.