SlideShare a Scribd company logo
process
Chapter two
Out line
Concept of process
Process management
System calls for process management
Implicit and explicit task
Process relation ship
Process state
Implementation of process
Thread
What is process?
process is defined as an entity which represents the
basic unit of work to be implemented in the system.
 A process is a program in execution.
 The execution of a process must progress in a
sequential fashion.
we can define a process is an executing program,
including the current values of the program counter,
registers, and variables.
Cont….
A process includes:
Program counter:-Stores the code that the processor
executes
Stack:-Stores instructions and local variables for
active procedure calls
Data section:-Stores variables and dynamically
allocated memory
The subtle difference between a process and a
program is that:
 Program is: the activity.
A group of instructions
Static entity
Cont…
Exist in a single space and continue to exist.
Programs contain instructions
Process
Dynamic entity
A group of instructions
Exist in a limited span of time.
Executes instruction, so Program ≠ process
Process management
A process needs certain resources,
including CPU time,
memory, files, and I/O devices, to
accomplish its task
The operating system is responsible for
the following activities in connection
with process management:
Process creation and deletion.
Termination of the process
Cont…
Controlling the progress of the process
Dispatching
Interrupt handling / Exceptional handling
Switching between the processes
Management of Process Control Blocks.
Process suspension and resumption (scheduling).
System call
System calls provide the interface between a process
and the operating system.
 These system calls are the routine services of the
operating system.
As an example of how system calls are used, consider
writing a simple program to read data from one file and
to copy them to another file.
There are two names of two different files in which one
input file and the other is the output file.
One approach is for the program to ask the user for the
names of the two files.
Cot…
Examples of some operating system calls are:
Create: In response to the create call the operating system
creates a new process with the specified or default
attributes and identifier.
Some of the parameters definable at the process
creation time include:
Level of privilege, such as system or user
priority
size and memory requirements
Cont..
 Delete: The delete service is also called destroy, terminate
or exit. Its execution causes the
operating system to destroy the designated process and
remove it from the system.
 Abort: It is used to terminate the process forcibly.
Although a process could conceivably abort itself, the most
frequent use of this call is for involuntary terminations,

Cont…
Fork/Join: Another method of process creation and
termination is by means of FORK/JOIN pair, originally
introduced as primitives for multiprocessor system.
The FORK operations are used to split a sequence of
instruction into two concurrently executable sequences.
 JOIN is used to merge the two sequences of code
divided by the FORK and it is available to a parent
process for synchronization with a child.
Cont..
Suspend: The suspend system call is also called BLOCK in
some systems.
 The designated process is suspended indefinitely and
placed in the suspend state.
Resume: The resume system call is also called WAKEUP
in some systems.
 Delay: The system call delay is also known as SLEEP.
Cont…
The target process is suspended for the duration of the
specified time period.
 Get Attributes: It is an enquiry to which the operating
system responds by providing the current values of the
process attributes, or their specified subset, from the
PCB.
Change Priority: It is an instance of a more general SET-
PROCESS-ATTRIBUTES system call.
Implicit and Explicit Tasking
A separate process at run time can be either
Implicit tasking or Explicit tasking.
Implicit tasking means that processes are defined by the
system.
It is commonly encountered in general purpose
multiprogramming systems.
In this approach, each program submitted for execution is
treated by the operating system as an independent process.

Cont..
Explicit tasking means that programs explicitly
define each process and some of its attributes.
 To improve the performance, a single logical
application is divided into various related
processes.
Explicit tasking is used in situations where high
performance in desired.
system programs such as parts of the operating
system and real time applications are common
examples of programs defined processes.
Processes Relationship
In the concurrent environment basically processes have
two relationships, competition and cooperation.
In the concurrent environment, processes compete
with each other for allocation of system resources to
execute their instructions.
In the competition, there should be proper resource
allocation and protection in address generation.
Cont…..
Cooperating process: In contrast to independent
processes, cooperating processes can affect or be
affected by other processes executing the system.
They are characterized by:
Their states are shared by other processes.
Their execution is not deterministic, i.e.,
the results of execution depend on relative execution
sequence and cannot be predicted in advance.
Their execution is irreproducible.
Process States
As defined, a process is an independent entity
with its own input values, output values, and
internal state.
A process often needs to interact with other
processes.
One process may generate some outputs that
other process uses as input.
 It is also possible for a process that is ready and
able to run to be blocked because the operating
system is decided to allocate the CPU to other
process for a while.
Cont…
A process state may be in one of the following:
New: The process is being created.
 After a process is created: parent and child have their own
distinct address spaces;
 If either process changes a word in its address space:
 Change is not visible to the other process;
Cont..
Ready: The process is waiting to be assigned to a
processor.
Running: Instructions are being executed.
Waiting/Suspended/Blocked: The process is waiting for
some event to occur.
Halted/Terminated: The process has finished execution.
Cont..
the process will terminate, usually due to one
of the following:
Normal exit (voluntary).
Error exit (voluntary).
Fatal error (involuntary).
Killed by another process (involuntary).
During the lifetime of a process, its state will
change a number of times:
Cont..
Implementation of Processes
To implement the process model, the operating
system maintains a table, an array of structures,
called the process table or process control block
(PCB) or Switch frame.
 Each entry identifies a process with information
such as process state, its program counter, stack
pointer, memory allocation, the status of its open
files, its accounting and scheduling information.
The following are the information stored in a PCB.
Process state, Process number( process ID)
CPU registers, Memory management information
I/O status information Processor scheduling information,
List of open files.
Context Switch
A context switch (also sometimes referred to as a
process switch or a task switch).
 Is the switching of the CPU (central processing
unit) from one process or to another.
A context switch is sometimes described as the
kernel suspending execution of one process on
the CPU and resuming execution of some other
process that had previously been suspended.
Context switch stpes
Process Hierarchy
Modern general purpose operating systems permit a
user to create and destroy processes.
Aprocess may create several new processes during its
time of execution.
The creating process is called parent process, while the
new processes are called child processes.
Cont..
Execution: The parent process continues to execute
concurrently with its children processes or it waits until
all of its children processes have terminated.
 Sharing: Either of them may share all resources, or the
children processes share only a subset of their parent’s
resources or the parent and children processes share no
resources in common.
What is thread
A thread is a flow of execution through the process
code, with its own program counter, system
registers and stack.
 A thread is also called a light weight process. T
Each thread belongs to exactly one process and no
thread can exist outside a process.
 Each thread represents a separate flow of control.
Difference between Process
and Thread
Process is heavy weight or resource intensive.
Thread is light weight taking lesser resources than a
process.
Process switching needs interaction with operating
system.
Thread switching does not need to interact with
operating system.
 In multiple processing environments each process
executes the same code but has its own memory and
file resources.
Cont..
All threads can share same set of open files, child
processes.
If one process is blocked then no other process can
execute until the first process is unblocked.
While one thread is blocked and waiting, second
thread in the same task can run.
 Multiple processes without using threads use more
resources. Multiple threaded processes use fewer
resources.
 In multiple processes each process operates
independently of the others. One thread can read,
write or change
Advantages of Thread
 Thread minimizes context switching time.
Use of threads provides concurrency within a
process.
Efficient communication.
 Economy- It is more economical to create
and context switch threads.
 Utilization of multiprocessor architectures to
a greater scale and efficiency
Disadvantages
In a typical operating system, most system
calls are blocking.
Multithreaded application cannot take
advantage of multiprocessing.
Types of Thread
Threads are implemented in following two ways
1, User Level Threads -- User managed threads
2, Kernel Level Threads -- Operating System managed
threads acting on kernel, an operating system core.
User Level Threads In this case, application manages
thread management kernel is not aware of the
existence of threads.
Cont..
Cont..
Advantages Thread switching does not require Kernel
mode privileges.
User level thread can run on any operating system.
Scheduling can be application specific in the user level
thread.
User level threads are fast to create and manage.
Disadvantages In a typical operating system, most system
calls are blocking.
Kernel Level Threads
thread management done by the Kernel.
Kernel threads are supported directly by the operating
system.
Any application can be programmed to be multithreaded.
All of the threads within an application are supported
within a single process.
The Kernel performs thread creation, scheduling and
management in Kernel space. Kernel threads are generally
slower to create and manage than the user threads.
Cont…
Advantages Kernel can simultaneously schedule multiple
threads from the same process on multiple processes.
If one thread in a process is blocked, the Kernel can
schedule another thread of the same process.
Kernel routines themselves can multithreaded.
Disadvantages Kernel threads are generally slower to
create and manage than the user threads.
 Transfer of control from one thread to another within
same process requires a mode switch to the Kernel.
Cont…..
Many to One Model
Many to one model maps many user level threads to one
Kernel level thread.
Thread management is done in user space.
When thread makes a blocking system call, the entire
process will be blocks.
Only one thread can access the Kernel at a time, so multiple
threads are unable to run in parallel on multiprocessors.
One to One Model
There is one to one relationship of user level
thread to the kernel level thread.
 This model provides more concurrency than the
many to one model.
It also another thread to run when a thread
makes a blocking system call.
It support multiple thread to execute in parallel
on microprocessors.
Difference between User Level &
Kernel Level Thread
 User level threads are faster to create and
manage.
 Kernel level threads are slower to create and
manage.
In user level Implementation is by a thread library
at the user level.
In kernel level Operating system supports creation
of Kernel threads.

More Related Content

Similar to Chapter two process.pptx

Difference Program vs Process vs Thread
Difference Program vs Process vs ThreadDifference Program vs Process vs Thread
Difference Program vs Process vs Thread
jeetendra mandal
 
Ch2_Processes_and_process_management_1.ppt
Ch2_Processes_and_process_management_1.pptCh2_Processes_and_process_management_1.ppt
Ch2_Processes_and_process_management_1.ppt
Mohammad Almuiet
 
My ppt @ bec doms on process management
My ppt @ bec doms on process managementMy ppt @ bec doms on process management
My ppt @ bec doms on process management
Babasab Patil
 
My ppt @ bec doms on process management
My ppt @ bec doms on process managementMy ppt @ bec doms on process management
My ppt @ bec doms on process management
Babasab Patil
 
OS - Chapter # 3 for the development of os
OS - Chapter # 3 for the development of osOS - Chapter # 3 for the development of os
OS - Chapter # 3 for the development of os
TahaShahid18
 
Operating System Process Scheduling.pptx
Operating System Process Scheduling.pptxOperating System Process Scheduling.pptx
Operating System Process Scheduling.pptx
Muhammad Athar
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process Concepts
Mukesh Chinta
 
Process management os concept
Process management os conceptProcess management os concept
Process management os concept
priyadeosarkar91
 
Chapter 5
Chapter 5Chapter 5
Operating system - Process and its concepts
Operating system - Process and its conceptsOperating system - Process and its concepts
Operating system - Process and its concepts
Karan Thakkar
 
Unit 2 part 2(Process)
Unit 2 part 2(Process)Unit 2 part 2(Process)
Unit 2 part 2(Process)
WajeehaBaig
 
UNIT - 3 PPT(Part- 1)_.pdf
UNIT - 3 PPT(Part- 1)_.pdfUNIT - 3 PPT(Part- 1)_.pdf
UNIT - 3 PPT(Part- 1)_.pdf
AyushSharma651966
 
THE BASIC CONCEPTS OF PROCESSING MANAGEMENT chapter 2.pptx
THE BASIC CONCEPTS OF PROCESSING MANAGEMENT chapter 2.pptxTHE BASIC CONCEPTS OF PROCESSING MANAGEMENT chapter 2.pptx
THE BASIC CONCEPTS OF PROCESSING MANAGEMENT chapter 2.pptx
natyesu
 
UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
YogapriyaJ1
 
Process & Thread Management
Process & Thread  ManagementProcess & Thread  Management
Process & Thread Management
Vpmv
 

Similar to Chapter two process.pptx (20)

Os
OsOs
Os
 
Difference Program vs Process vs Thread
Difference Program vs Process vs ThreadDifference Program vs Process vs Thread
Difference Program vs Process vs Thread
 
Ch2_Processes_and_process_management_1.ppt
Ch2_Processes_and_process_management_1.pptCh2_Processes_and_process_management_1.ppt
Ch2_Processes_and_process_management_1.ppt
 
My ppt @ bec doms on process management
My ppt @ bec doms on process managementMy ppt @ bec doms on process management
My ppt @ bec doms on process management
 
My ppt @ bec doms on process management
My ppt @ bec doms on process managementMy ppt @ bec doms on process management
My ppt @ bec doms on process management
 
OS - Chapter # 3 for the development of os
OS - Chapter # 3 for the development of osOS - Chapter # 3 for the development of os
OS - Chapter # 3 for the development of os
 
Operating System Process Scheduling.pptx
Operating System Process Scheduling.pptxOperating System Process Scheduling.pptx
Operating System Process Scheduling.pptx
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process Concepts
 
Process management os concept
Process management os conceptProcess management os concept
Process management os concept
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
Operating system - Process and its concepts
Operating system - Process and its conceptsOperating system - Process and its concepts
Operating system - Process and its concepts
 
Operating system
Operating systemOperating system
Operating system
 
Unit 2 part 2(Process)
Unit 2 part 2(Process)Unit 2 part 2(Process)
Unit 2 part 2(Process)
 
UNIT - 3 PPT(Part- 1)_.pdf
UNIT - 3 PPT(Part- 1)_.pdfUNIT - 3 PPT(Part- 1)_.pdf
UNIT - 3 PPT(Part- 1)_.pdf
 
Process Management
Process ManagementProcess Management
Process Management
 
Ch4
Ch4Ch4
Ch4
 
THE BASIC CONCEPTS OF PROCESSING MANAGEMENT chapter 2.pptx
THE BASIC CONCEPTS OF PROCESSING MANAGEMENT chapter 2.pptxTHE BASIC CONCEPTS OF PROCESSING MANAGEMENT chapter 2.pptx
THE BASIC CONCEPTS OF PROCESSING MANAGEMENT chapter 2.pptx
 
UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
 
Process & Thread Management
Process & Thread  ManagementProcess & Thread  Management
Process & Thread Management
 
Supply chain mgmt
Supply chain mgmtSupply chain mgmt
Supply chain mgmt
 

Recently uploaded

Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 

Recently uploaded (20)

Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 

Chapter two process.pptx

  • 2. Out line Concept of process Process management System calls for process management Implicit and explicit task Process relation ship Process state Implementation of process Thread
  • 3. What is process? process is defined as an entity which represents the basic unit of work to be implemented in the system.  A process is a program in execution.  The execution of a process must progress in a sequential fashion. we can define a process is an executing program, including the current values of the program counter, registers, and variables.
  • 4. Cont…. A process includes: Program counter:-Stores the code that the processor executes Stack:-Stores instructions and local variables for active procedure calls Data section:-Stores variables and dynamically allocated memory The subtle difference between a process and a program is that:  Program is: the activity. A group of instructions Static entity
  • 5. Cont… Exist in a single space and continue to exist. Programs contain instructions Process Dynamic entity A group of instructions Exist in a limited span of time. Executes instruction, so Program ≠ process
  • 6. Process management A process needs certain resources, including CPU time, memory, files, and I/O devices, to accomplish its task The operating system is responsible for the following activities in connection with process management: Process creation and deletion. Termination of the process
  • 7. Cont… Controlling the progress of the process Dispatching Interrupt handling / Exceptional handling Switching between the processes Management of Process Control Blocks. Process suspension and resumption (scheduling).
  • 8. System call System calls provide the interface between a process and the operating system.  These system calls are the routine services of the operating system. As an example of how system calls are used, consider writing a simple program to read data from one file and to copy them to another file. There are two names of two different files in which one input file and the other is the output file. One approach is for the program to ask the user for the names of the two files.
  • 9. Cot… Examples of some operating system calls are: Create: In response to the create call the operating system creates a new process with the specified or default attributes and identifier. Some of the parameters definable at the process creation time include: Level of privilege, such as system or user priority size and memory requirements
  • 10. Cont..  Delete: The delete service is also called destroy, terminate or exit. Its execution causes the operating system to destroy the designated process and remove it from the system.  Abort: It is used to terminate the process forcibly. Although a process could conceivably abort itself, the most frequent use of this call is for involuntary terminations, 
  • 11. Cont… Fork/Join: Another method of process creation and termination is by means of FORK/JOIN pair, originally introduced as primitives for multiprocessor system. The FORK operations are used to split a sequence of instruction into two concurrently executable sequences.  JOIN is used to merge the two sequences of code divided by the FORK and it is available to a parent process for synchronization with a child.
  • 12. Cont.. Suspend: The suspend system call is also called BLOCK in some systems.  The designated process is suspended indefinitely and placed in the suspend state. Resume: The resume system call is also called WAKEUP in some systems.  Delay: The system call delay is also known as SLEEP.
  • 13. Cont… The target process is suspended for the duration of the specified time period.  Get Attributes: It is an enquiry to which the operating system responds by providing the current values of the process attributes, or their specified subset, from the PCB. Change Priority: It is an instance of a more general SET- PROCESS-ATTRIBUTES system call.
  • 14. Implicit and Explicit Tasking A separate process at run time can be either Implicit tasking or Explicit tasking. Implicit tasking means that processes are defined by the system. It is commonly encountered in general purpose multiprogramming systems. In this approach, each program submitted for execution is treated by the operating system as an independent process. 
  • 15. Cont.. Explicit tasking means that programs explicitly define each process and some of its attributes.  To improve the performance, a single logical application is divided into various related processes. Explicit tasking is used in situations where high performance in desired. system programs such as parts of the operating system and real time applications are common examples of programs defined processes.
  • 16. Processes Relationship In the concurrent environment basically processes have two relationships, competition and cooperation. In the concurrent environment, processes compete with each other for allocation of system resources to execute their instructions. In the competition, there should be proper resource allocation and protection in address generation.
  • 17. Cont….. Cooperating process: In contrast to independent processes, cooperating processes can affect or be affected by other processes executing the system. They are characterized by: Their states are shared by other processes. Their execution is not deterministic, i.e., the results of execution depend on relative execution sequence and cannot be predicted in advance. Their execution is irreproducible.
  • 18. Process States As defined, a process is an independent entity with its own input values, output values, and internal state. A process often needs to interact with other processes. One process may generate some outputs that other process uses as input.  It is also possible for a process that is ready and able to run to be blocked because the operating system is decided to allocate the CPU to other process for a while.
  • 19. Cont… A process state may be in one of the following: New: The process is being created.  After a process is created: parent and child have their own distinct address spaces;  If either process changes a word in its address space:  Change is not visible to the other process;
  • 20. Cont.. Ready: The process is waiting to be assigned to a processor. Running: Instructions are being executed. Waiting/Suspended/Blocked: The process is waiting for some event to occur. Halted/Terminated: The process has finished execution.
  • 21. Cont.. the process will terminate, usually due to one of the following: Normal exit (voluntary). Error exit (voluntary). Fatal error (involuntary). Killed by another process (involuntary). During the lifetime of a process, its state will change a number of times:
  • 23. Implementation of Processes To implement the process model, the operating system maintains a table, an array of structures, called the process table or process control block (PCB) or Switch frame.  Each entry identifies a process with information such as process state, its program counter, stack pointer, memory allocation, the status of its open files, its accounting and scheduling information.
  • 24. The following are the information stored in a PCB. Process state, Process number( process ID) CPU registers, Memory management information I/O status information Processor scheduling information, List of open files.
  • 25. Context Switch A context switch (also sometimes referred to as a process switch or a task switch).  Is the switching of the CPU (central processing unit) from one process or to another. A context switch is sometimes described as the kernel suspending execution of one process on the CPU and resuming execution of some other process that had previously been suspended.
  • 27. Process Hierarchy Modern general purpose operating systems permit a user to create and destroy processes. Aprocess may create several new processes during its time of execution. The creating process is called parent process, while the new processes are called child processes.
  • 28. Cont.. Execution: The parent process continues to execute concurrently with its children processes or it waits until all of its children processes have terminated.  Sharing: Either of them may share all resources, or the children processes share only a subset of their parent’s resources or the parent and children processes share no resources in common.
  • 29. What is thread A thread is a flow of execution through the process code, with its own program counter, system registers and stack.  A thread is also called a light weight process. T Each thread belongs to exactly one process and no thread can exist outside a process.  Each thread represents a separate flow of control.
  • 30. Difference between Process and Thread Process is heavy weight or resource intensive. Thread is light weight taking lesser resources than a process. Process switching needs interaction with operating system. Thread switching does not need to interact with operating system.  In multiple processing environments each process executes the same code but has its own memory and file resources.
  • 31. Cont.. All threads can share same set of open files, child processes. If one process is blocked then no other process can execute until the first process is unblocked. While one thread is blocked and waiting, second thread in the same task can run.  Multiple processes without using threads use more resources. Multiple threaded processes use fewer resources.  In multiple processes each process operates independently of the others. One thread can read, write or change
  • 32. Advantages of Thread  Thread minimizes context switching time. Use of threads provides concurrency within a process. Efficient communication.  Economy- It is more economical to create and context switch threads.  Utilization of multiprocessor architectures to a greater scale and efficiency
  • 33. Disadvantages In a typical operating system, most system calls are blocking. Multithreaded application cannot take advantage of multiprocessing.
  • 34. Types of Thread Threads are implemented in following two ways 1, User Level Threads -- User managed threads 2, Kernel Level Threads -- Operating System managed threads acting on kernel, an operating system core. User Level Threads In this case, application manages thread management kernel is not aware of the existence of threads.
  • 36. Cont.. Advantages Thread switching does not require Kernel mode privileges. User level thread can run on any operating system. Scheduling can be application specific in the user level thread. User level threads are fast to create and manage. Disadvantages In a typical operating system, most system calls are blocking.
  • 37. Kernel Level Threads thread management done by the Kernel. Kernel threads are supported directly by the operating system. Any application can be programmed to be multithreaded. All of the threads within an application are supported within a single process. The Kernel performs thread creation, scheduling and management in Kernel space. Kernel threads are generally slower to create and manage than the user threads.
  • 38. Cont… Advantages Kernel can simultaneously schedule multiple threads from the same process on multiple processes. If one thread in a process is blocked, the Kernel can schedule another thread of the same process. Kernel routines themselves can multithreaded. Disadvantages Kernel threads are generally slower to create and manage than the user threads.  Transfer of control from one thread to another within same process requires a mode switch to the Kernel.
  • 40. Many to One Model Many to one model maps many user level threads to one Kernel level thread. Thread management is done in user space. When thread makes a blocking system call, the entire process will be blocks. Only one thread can access the Kernel at a time, so multiple threads are unable to run in parallel on multiprocessors.
  • 41. One to One Model There is one to one relationship of user level thread to the kernel level thread.  This model provides more concurrency than the many to one model. It also another thread to run when a thread makes a blocking system call. It support multiple thread to execute in parallel on microprocessors.
  • 42. Difference between User Level & Kernel Level Thread  User level threads are faster to create and manage.  Kernel level threads are slower to create and manage. In user level Implementation is by a thread library at the user level. In kernel level Operating system supports creation of Kernel threads.