SlideShare a Scribd company logo
Operating System
Chapter 3: Process
Process
A process is a program in execution.
A process is more than the program
code, which is sometimes known as the
text section. It also includes the
current activity, as represented by
the value of the program counter and
the contents of the processor's
registers.
Process states
As a process executes, it changes state. The state of a process is defined
in part by the current activity of that process. Each process may be in one
of the following states:
Instructions are being
executed.
The process is waiting
to be assigned to a
processor.
The process is being
created.
The process is waiting
for some event to occur
(such as an I/O
completion or reception
of a signal)
The process has finished
execution.
01
New
02
Running
03
Waiting
04
Ready
05
Terminated
Process states
These names are arbitrary, and they vary across operating systems. The states
that they represent are found on all systems, however. Certain operating
systems also more finely delineate process states. It is important to realize
that only one process can be running on any processor at any instant. Many
processes may be ready and limiting, however. The state diagram corresponding
to these states is presented in bellow figure:
Ready Run TerminatedNew
Wait/Block
SuspendWait
Suspend Ready
Schedule/Dispatch
Priority/Time quantum
Completion
I/O completion
Suspend
Resume
I/O completed but still in suspend
Resume
Suspend
Process control block (PCB)
Each process is represented in the operating system by a process control
block (PCB)—also called a task control block. A PCB is shown in bellow
figure:
Information of PCB
PCB contains many pieces of information associated with a specific process,
including these:
The state may be new, ready, running, waiting, halted, and so on.
The counter indicates the address of the next instruction to
be executed for this process.
The registers vary in number and type, depending on
the computer architecture.They include accumulators,
index registers, stack pointers, and general-purpose
registers, plus any condition-code information. .
This information includes a process priority,
pointers to scheduling queues, and any other
scheduling parameters.
This information may include such information as the
value of the base and limit registers, the page tables,
or the segment tables, depending on the memory
system used by the operating system.
This information includes the amount of CPU and
real time used, time limits, account members, job
or process numbers, and so on.
This information includes the list of I/O devices allocated to the process,
a list of open files, and so on. In brief, the PCB simply serves as the
repository for any information that may vary from process to process.
Process state01
Program counter02
CPU registers03
CPU-scheduling
information
04
Memory-management
information
05
Accounting information06
I/O status
information
07
PCB
PCB
Highlights
Process scheduling queue
The OS maintains all PCBs in Process Scheduling Queues. The OS maintains a separate
queue for each of the process states and PCBs of all processes in the same execution
state are placed in the same queue.
The Operating System maintains the following important process scheduling queues −
Process scheduling
Partially executed
swapped-out processes
Ready queue CPU
I/O I/O queue I/O queue
Time slice expired
Child
executes
Fork a child
Interrupt
occurs
Wait for an
interrupt
Swap in Swap out
end
Classification of scheduling or scheduler
1
2
3
Medium-term
scheduler
The key idea behind a medium-term scheduler is that
sometimes it can be advantageous to remove
processes from memory (and from active contention
for the CPU) and thus reduce the degree of
multiprogramming.
Long-term
scheduler
The long-term scheduler, or job scheduler, selects
processes from this pool and loads them into
memory for execution.
Short-term
scheduler
The short-term scheduler, or CPU scheduler,
selects from among the processes that are
ready to execute and allocates the CPU to
one of them.
Kinds of process
I/O-bound processYourText Here
An I/O-bound process is one
that spends more of its time
doing I/O than it spends doing
computations.
A CPU-bound process, in
contrast, generates I/O
requests infrequently, using
more of its time doing
computations.
2
1
CPU-bound process
Process states
Switching the CPU to another process requires performing a state save of the
current process and a state restore of a different process. This task is known
as a context switch.
Context-switch times are highly dependent on hardware support. A context switch
here simply requires changing the pointer to the current register set.
process Po operating system process P1
Save into PCBo
Save into PCB1
Save into PCB1
Save into PCBo
.
.
.
.
.
.
Interrupt or system call
Interrupt or system call
idle
idle
idle executing
executing
executing
Prepared by:
Ankon Gopal Banik
Front End Developer | WWF
(Web With Friends)
m: +8801771981989
p: 027730402
e: agbanik2081@outlook.com
75-B, Kyetpara, Dhamrai,
Dhaka, Bangladesh
www.wwfriends.org

More Related Content

PPT
5. spooling and buffering
PPT
Types of Operating System
PPT
Os Threads
PDF
Linux System Monitoring basic commands
PPT
Operating system services 9
PPTX
Introduction to Network and System Administration
PPTX
Types Of Operating Systems
5. spooling and buffering
Types of Operating System
Os Threads
Linux System Monitoring basic commands
Operating system services 9
Introduction to Network and System Administration
Types Of Operating Systems

What's hot (20)

PPTX
cpu scheduling
PPTX
Dead Lock in operating system
PPT
OS Process and Thread Concepts
PPTX
Operating system
PPTX
Resource Monitoring and management
PDF
Operating systems system structures
PDF
Course 102: Lecture 14: Users and Permissions
PPT
Chapter 3 - Processes
PPTX
Systems Administration
PPT
Services provided by os
PPT
Unit 3 file management
PPTX
Lecture 2 process
PPTX
Os unit 3 , process management
PPTX
Operating Systems - Processor Management
PPTX
Computing Environment
PPTX
Priority Scheduling
PPTX
Deadlock ppt
PDF
Operating system concepts (notes)
PPTX
Multithreading
PPT
Input output in linux
cpu scheduling
Dead Lock in operating system
OS Process and Thread Concepts
Operating system
Resource Monitoring and management
Operating systems system structures
Course 102: Lecture 14: Users and Permissions
Chapter 3 - Processes
Systems Administration
Services provided by os
Unit 3 file management
Lecture 2 process
Os unit 3 , process management
Operating Systems - Processor Management
Computing Environment
Priority Scheduling
Deadlock ppt
Operating system concepts (notes)
Multithreading
Input output in linux
Ad

Similar to Operating system || Chapter 3: Process (20)

PDF
Unit 2 part 1(Process)
PPT
Operating System 3
PPT
4 process
PDF
OS - Process Concepts
PPTX
Operating Systems Process Management.pptx
PPTX
Operating System Process Scheduling.pptx
PDF
Operating System-Concepts of Process
PPTX
operating system module 2 presentation notes
PDF
OS-Process.pdf
PPTX
Unit 2_OS process management
DOC
Operating Systems Unit Two - Fourth Semester - Engineering
PDF
Process Management.pdf
PPTX
UNIT I-Processes.pptx
PPTX
Operating System process management system.pptx
PDF
Chapter 3.pdf
PPTX
ch2nvbjdvsbjbjfjjfjf j Process Mangement.pptx
PPTX
Module- Operating Systems presentation Two
PPTX
Process and thread Management Operating system
PDF
Unit 1.1.pdfOperating_SystemOperating_System
PPTX
OS_Unit II - Process Management_CATI.pptx
Unit 2 part 1(Process)
Operating System 3
4 process
OS - Process Concepts
Operating Systems Process Management.pptx
Operating System Process Scheduling.pptx
Operating System-Concepts of Process
operating system module 2 presentation notes
OS-Process.pdf
Unit 2_OS process management
Operating Systems Unit Two - Fourth Semester - Engineering
Process Management.pdf
UNIT I-Processes.pptx
Operating System process management system.pptx
Chapter 3.pdf
ch2nvbjdvsbjbjfjjfjf j Process Mangement.pptx
Module- Operating Systems presentation Two
Process and thread Management Operating system
Unit 1.1.pdfOperating_SystemOperating_System
OS_Unit II - Process Management_CATI.pptx
Ad

More from AnkonGopalBanik (6)

PPTX
Register
PPTX
Pipeline hazard
PPTX
Synchronous & Asynchronous data transmission
PPTX
Addressing Modes
PPTX
IEEE 488
PPTX
Operating system || Chapter 1: Introduction
Register
Pipeline hazard
Synchronous & Asynchronous data transmission
Addressing Modes
IEEE 488
Operating system || Chapter 1: Introduction

Recently uploaded (20)

PDF
Complications of Minimal Access Surgery at WLH
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Business Ethics Teaching Materials for college
PPTX
Cell Structure & Organelles in detailed.
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Pre independence Education in Inndia.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PDF
Basic Mud Logging Guide for educational purpose
PDF
O7-L3 Supply Chain Operations - ICLT Program
Complications of Minimal Access Surgery at WLH
PPH.pptx obstetrics and gynecology in nursing
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Business Ethics Teaching Materials for college
Cell Structure & Organelles in detailed.
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Pre independence Education in Inndia.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Supply Chain Operations Speaking Notes -ICLT Program
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
human mycosis Human fungal infections are called human mycosis..pptx
Microbial disease of the cardiovascular and lymphatic systems
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Week 4 Term 3 Study Techniques revisited.pptx
Basic Mud Logging Guide for educational purpose
O7-L3 Supply Chain Operations - ICLT Program

Operating system || Chapter 3: Process

  • 2. Process A process is a program in execution. A process is more than the program code, which is sometimes known as the text section. It also includes the current activity, as represented by the value of the program counter and the contents of the processor's registers.
  • 3. Process states As a process executes, it changes state. The state of a process is defined in part by the current activity of that process. Each process may be in one of the following states: Instructions are being executed. The process is waiting to be assigned to a processor. The process is being created. The process is waiting for some event to occur (such as an I/O completion or reception of a signal) The process has finished execution. 01 New 02 Running 03 Waiting 04 Ready 05 Terminated
  • 4. Process states These names are arbitrary, and they vary across operating systems. The states that they represent are found on all systems, however. Certain operating systems also more finely delineate process states. It is important to realize that only one process can be running on any processor at any instant. Many processes may be ready and limiting, however. The state diagram corresponding to these states is presented in bellow figure: Ready Run TerminatedNew Wait/Block SuspendWait Suspend Ready Schedule/Dispatch Priority/Time quantum Completion I/O completion Suspend Resume I/O completed but still in suspend Resume Suspend
  • 5. Process control block (PCB) Each process is represented in the operating system by a process control block (PCB)—also called a task control block. A PCB is shown in bellow figure:
  • 6. Information of PCB PCB contains many pieces of information associated with a specific process, including these: The state may be new, ready, running, waiting, halted, and so on. The counter indicates the address of the next instruction to be executed for this process. The registers vary in number and type, depending on the computer architecture.They include accumulators, index registers, stack pointers, and general-purpose registers, plus any condition-code information. . This information includes a process priority, pointers to scheduling queues, and any other scheduling parameters. This information may include such information as the value of the base and limit registers, the page tables, or the segment tables, depending on the memory system used by the operating system. This information includes the amount of CPU and real time used, time limits, account members, job or process numbers, and so on. This information includes the list of I/O devices allocated to the process, a list of open files, and so on. In brief, the PCB simply serves as the repository for any information that may vary from process to process. Process state01 Program counter02 CPU registers03 CPU-scheduling information 04 Memory-management information 05 Accounting information06 I/O status information 07 PCB PCB Highlights
  • 7. Process scheduling queue The OS maintains all PCBs in Process Scheduling Queues. The OS maintains a separate queue for each of the process states and PCBs of all processes in the same execution state are placed in the same queue. The Operating System maintains the following important process scheduling queues −
  • 8. Process scheduling Partially executed swapped-out processes Ready queue CPU I/O I/O queue I/O queue Time slice expired Child executes Fork a child Interrupt occurs Wait for an interrupt Swap in Swap out end
  • 9. Classification of scheduling or scheduler 1 2 3 Medium-term scheduler The key idea behind a medium-term scheduler is that sometimes it can be advantageous to remove processes from memory (and from active contention for the CPU) and thus reduce the degree of multiprogramming. Long-term scheduler The long-term scheduler, or job scheduler, selects processes from this pool and loads them into memory for execution. Short-term scheduler The short-term scheduler, or CPU scheduler, selects from among the processes that are ready to execute and allocates the CPU to one of them.
  • 10. Kinds of process I/O-bound processYourText Here An I/O-bound process is one that spends more of its time doing I/O than it spends doing computations. A CPU-bound process, in contrast, generates I/O requests infrequently, using more of its time doing computations. 2 1 CPU-bound process
  • 11. Process states Switching the CPU to another process requires performing a state save of the current process and a state restore of a different process. This task is known as a context switch. Context-switch times are highly dependent on hardware support. A context switch here simply requires changing the pointer to the current register set. process Po operating system process P1 Save into PCBo Save into PCB1 Save into PCB1 Save into PCBo . . . . . . Interrupt or system call Interrupt or system call idle idle idle executing executing executing
  • 12. Prepared by: Ankon Gopal Banik Front End Developer | WWF (Web With Friends) m: +8801771981989 p: 027730402 e: agbanik2081@outlook.com 75-B, Kyetpara, Dhamrai, Dhaka, Bangladesh www.wwfriends.org