SlideShare a Scribd company logo
Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 1
Chapter 2: Processes
Process Concept
Process States
Process Control Block(PCB)
Process Scheduling
Operations on Processes
Cooperating Processes
Inter process Communication
Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 2
Process Concept
An operating system executes a variety of programs:
 Batch system – jobs
 Time-shared systems – user programs or tasks
The terms job and process are almost interchangeable.
Process – a program in execution or manipulation
A process has the attributes(properties) of
 program counter
Is used to keep track of the address
0f the next instruction to be executed.
 Stack: Is used to store temporary data for the process.
Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 3
Five State Process Model
As a process executes, it changes
state
 new: The process is being
created.
 ready: The process is waiting
to be assigned to a process.
 running: Instructions are
being executed.
 waiting: The process is
waiting for some event to
occur.
 terminated: The process has
finished execution.
OperatingSystem02..(B.SC Part 2)
State Transition in Process
New to Ready: Admitted to Ready queue, can be considered by
CPU scheduler
Ready to Running: To be executed next for processing
Running to Ready: Process has used its current time slice
Running to Blocked: Process is waiting for some event to
occur.e.g I/O operation to complete.
Blocked to Ready: Whatever event the process was waiting has
occurred.
Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 5
Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 6
Process Control Block (PCB)
It is a data structure that contains all
the information for a process to be
used for controlling its execution and
the resources used for that process.
Every process has its own PCB.
Information associated with each
process.
Process state (Ready, running, wait)
Program counter (Points to the next
instruction to be executed)
CPU registers(Data is stored in
registers after Interrupt occurs )
Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 7
•CPU scheduling information: It holds the
information such as process priority.
•Memory-management information
(information such as base register, page
table etc)
•Accounting information: ( Holds the
amount of CPU time, process to date, or
process number)
•I/O status information: (Holds the list of
I/O devices)
Process Scheduling
Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 8
Technique used where there are limited resources and many
processes competing for them.
This is needed when there are more processes and one
processor.
In this way some processes will have to wait until CPU
becomes available. If there are more processes then the
operating system must schedule the process. Many
techniques are used for this purpose.
Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 9
Process Scheduling Queues
Job queue – set of all processes in the system.
Ready queue – set of all processes residing in main
memory, ready and waiting to execute.
Device queues – set of processes waiting for an I/O
device.
Process migration between
various queues
The process of moving between various
queues is known as Process migration.
i.e moving between ready, waiting and
possibly job queues and finally job finishes the
task.
Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 10
CPU Scheduler
Selects from among the processes in memory
that are ready to execute, and allocates the
CPU to one of them.
 Non-preemptive Scheduling
 Once CPU has been allocated to a process, the
process keeps the CPU until
 Process exits
 Preemptive Scheduling
 Process can be interrupted and must release the
CPU after time slice terminates.
Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 12
Schedulers
Long-term scheduler (or job scheduler) –
selects which processes should be brought from
job queue into the ready queue. Processes are
added to the system much less frequently then
processes are swapped between the ready queue
and CPU.The long term scheduler controls the
degree of multiprogramming. Long term
scheduler should select a good process mix of
processes to better the system performance. It
is also called as job scheduling.
Scheduler
LTS STS
JOB
QUEUE
READY
QUEUE
CPU
MAIN
MEMORY
SECONDARY
STORAGE
SHORT-TERM SCHEDULER:
(or CPU scheduler) – selects which process should
be executed next and allocates CPU. It selects a
process from ready queue and gives the control of
CPU to that process. Processes gets the CPU for a
short time slice while the short time scheduler
decides that which job well run next.
Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 14
Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 15
Medium Term Scheduling
Time sharing OSs may introduce a medium term
scheduler
Removes processes from memory to reduce the degree
of multiprogramming
It swaps the process between memory and secondary
storage. It improves the system by reducing the degree
of multiprogramming.
I/O-bound process – spends more time doing I/O than
computations.
CPU-bound process – spends more time doing
computations.
Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 16
Context Switch
When the CPU switches to another process, an
interrupt occurs.
The system must save the state of the old process
and load the saved state for the new process.
Context-switch time is overhead; the system does
no useful work while switching.
Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 17
Process Creation
Parent process create children processes which, in turn,
create other processes forming a tree of processes.
Each process is assigned a unique process identifier (pid)
Resource sharing
 Parent and children share all resources.
 Children share subset of parent’s resources.
Execution
 Parent and children execute concurrently.
 Parent waits until some or all of its children terminate.
Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 18
Process Termination
Process executes last statement and asks the
operating system to delete it by using the exit
 Time Slot finished
 Process’ resources are deal located by operating system.
Parent may terminate execution of children processes
 Child has exceeded allocated resources.
 Task assigned to child is no longer required.
 Parent is exiting.
 Some operating systems do not allow child to continue if its
parent terminates
Inter Process Communication
An IPC is used to provide two operations of sending
and receiving message. If two process wish two
communicate with each other.
 Establish a communication link between them.
 Exchange messages using the send and receive
operations.
 To synchronize there actions
Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 19
Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 20
Direct Communication
Processes must name each other explicitly (a
disadvantage):
 send (P, message) – send a message to process P
 receive(Q, message) – receive a message from process Q
Properties of communication link
 Links are established automatically.
 A link is associated with exactly one pair of communicating
processes.
 Between each pair there exists exactly one link.
 The link may be unidirectional, but is usually bi-directional.
 the print server.
Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 21
Indirect Communication
Messages are directed and received from mailboxes
(also referred to as ports).
 Each mailbox has a unique id.
 Processes can communicate only if they share a mailbox.
Properties of communication link
 Link established only if processes share a common mailbox
 A link may be associated with many processes.
 Each pair of processes may share several communication
links.
 Link may be unidirectional or bi-directional.
Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 22
Buffering(RAM)
Whether the communication link is direct or
indirect, messages exchanged by communicating
processes resides in a temporary queue.
e.g Copy, Paste
Bounded capacity
Unbounded capacity
Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 23

More Related Content

PPT
Process threads operating system.
PPT
Chapter 3 - Processes
PPT
process creation OS
PDF
3 processes
PPTX
Chapter 14 Computer Architecture
PDF
2 os structure
PDF
Unit II - 1 - Operating System Process
PPTX
Unix Process management
Process threads operating system.
Chapter 3 - Processes
process creation OS
3 processes
Chapter 14 Computer Architecture
2 os structure
Unit II - 1 - Operating System Process
Unix Process management

What's hot (17)

PPT
Chapter 3: Processes
PDF
Operating Systems 1 (6/12) - Processes
DOC
Bt0070
PPTX
Process creation and termination In Operating System
PDF
Operating System - Unit I - Operating System Structures
PPT
Chapter 7
DOC
Operating Systems Unit Two - Fourth Semester - Engineering
PPTX
Chapter 10 Operating Systems silberschatz
PPTX
Process state in OS
PDF
Unit II - 2 - Operating System - Threads
PPTX
Process concept
PPT
Top schools in ghaziabad
PPT
OS Chapter03
PPT
Concurrent process
PPTX
Process in operating system
Chapter 3: Processes
Operating Systems 1 (6/12) - Processes
Bt0070
Process creation and termination In Operating System
Operating System - Unit I - Operating System Structures
Chapter 7
Operating Systems Unit Two - Fourth Semester - Engineering
Chapter 10 Operating Systems silberschatz
Process state in OS
Unit II - 2 - Operating System - Threads
Process concept
Top schools in ghaziabad
OS Chapter03
Concurrent process
Process in operating system
Ad

Similar to OperatingSystem02..(B.SC Part 2) (20)

PPT
Unit 2 chapter notes for the student1-1.ppt
PDF
OS - Process Concepts
PPTX
UNIT I-Processes.pptx
PPTX
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
PPTX
ch2nvbjdvsbjbjfjjfjf j Process Mangement.pptx
PPT
Ch2_Processes_and_process_management_1.ppt
PPT
LEC_3.ppt jef,fdds,fn,befhj efbhjfrgeukevbhwj
PDF
Chapter 3.pdf
PPTX
OS UNIT-II-PPT.pptx-operating systems complete notes
PPT
OS UNIT2.ppt
PPT
Ch03- PROCESSES.ppt
PPT
OS-operating systems- ch03
PPTX
2Chapter Two- Process Management(2) (1).pptx
PPT
CSW355-OS-ch3-Selected (11111111111).ppt
PPT
UNIT I Process management main concept.ppt
PPTX
Operating Systems - Processor Management
PPTX
Operating System Process Management.pptx
PDF
Ch3OperSys
PDF
OperatingSystemChp3
PPTX
Handling Large Data Volumes in Salesforce with Apex
Unit 2 chapter notes for the student1-1.ppt
OS - Process Concepts
UNIT I-Processes.pptx
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
ch2nvbjdvsbjbjfjjfjf j Process Mangement.pptx
Ch2_Processes_and_process_management_1.ppt
LEC_3.ppt jef,fdds,fn,befhj efbhjfrgeukevbhwj
Chapter 3.pdf
OS UNIT-II-PPT.pptx-operating systems complete notes
OS UNIT2.ppt
Ch03- PROCESSES.ppt
OS-operating systems- ch03
2Chapter Two- Process Management(2) (1).pptx
CSW355-OS-ch3-Selected (11111111111).ppt
UNIT I Process management main concept.ppt
Operating Systems - Processor Management
Operating System Process Management.pptx
Ch3OperSys
OperatingSystemChp3
Handling Large Data Volumes in Salesforce with Apex
Ad

Recently uploaded (20)

PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Weekly quiz Compilation Jan -July 25.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Computing-Curriculum for Schools in Ghana
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Yogi Goddess Pres Conference Studio Updates
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Classroom Observation Tools for Teachers
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
Supply Chain Operations Speaking Notes -ICLT Program
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Weekly quiz Compilation Jan -July 25.pdf
Microbial diseases, their pathogenesis and prophylaxis
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Cell Types and Its function , kingdom of life
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Computing-Curriculum for Schools in Ghana
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
human mycosis Human fungal infections are called human mycosis..pptx
VCE English Exam - Section C Student Revision Booklet
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Module 4: Burden of Disease Tutorial Slides S2 2025
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Yogi Goddess Pres Conference Studio Updates
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
Final Presentation General Medicine 03-08-2024.pptx
Classroom Observation Tools for Teachers
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Supply Chain Operations Speaking Notes -ICLT Program

OperatingSystem02..(B.SC Part 2)

  • 1. Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 1 Chapter 2: Processes Process Concept Process States Process Control Block(PCB) Process Scheduling Operations on Processes Cooperating Processes Inter process Communication
  • 2. Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 2 Process Concept An operating system executes a variety of programs:  Batch system – jobs  Time-shared systems – user programs or tasks The terms job and process are almost interchangeable. Process – a program in execution or manipulation A process has the attributes(properties) of  program counter Is used to keep track of the address 0f the next instruction to be executed.  Stack: Is used to store temporary data for the process.
  • 3. Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 3 Five State Process Model As a process executes, it changes state  new: The process is being created.  ready: The process is waiting to be assigned to a process.  running: Instructions are being executed.  waiting: The process is waiting for some event to occur.  terminated: The process has finished execution.
  • 5. State Transition in Process New to Ready: Admitted to Ready queue, can be considered by CPU scheduler Ready to Running: To be executed next for processing Running to Ready: Process has used its current time slice Running to Blocked: Process is waiting for some event to occur.e.g I/O operation to complete. Blocked to Ready: Whatever event the process was waiting has occurred. Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 5
  • 6. Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 6 Process Control Block (PCB) It is a data structure that contains all the information for a process to be used for controlling its execution and the resources used for that process. Every process has its own PCB. Information associated with each process. Process state (Ready, running, wait) Program counter (Points to the next instruction to be executed) CPU registers(Data is stored in registers after Interrupt occurs )
  • 7. Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 7 •CPU scheduling information: It holds the information such as process priority. •Memory-management information (information such as base register, page table etc) •Accounting information: ( Holds the amount of CPU time, process to date, or process number) •I/O status information: (Holds the list of I/O devices)
  • 8. Process Scheduling Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 8 Technique used where there are limited resources and many processes competing for them. This is needed when there are more processes and one processor. In this way some processes will have to wait until CPU becomes available. If there are more processes then the operating system must schedule the process. Many techniques are used for this purpose.
  • 9. Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 9 Process Scheduling Queues Job queue – set of all processes in the system. Ready queue – set of all processes residing in main memory, ready and waiting to execute. Device queues – set of processes waiting for an I/O device.
  • 10. Process migration between various queues The process of moving between various queues is known as Process migration. i.e moving between ready, waiting and possibly job queues and finally job finishes the task. Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 10
  • 11. CPU Scheduler Selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them.  Non-preemptive Scheduling  Once CPU has been allocated to a process, the process keeps the CPU until  Process exits  Preemptive Scheduling  Process can be interrupted and must release the CPU after time slice terminates.
  • 12. Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 12 Schedulers Long-term scheduler (or job scheduler) – selects which processes should be brought from job queue into the ready queue. Processes are added to the system much less frequently then processes are swapped between the ready queue and CPU.The long term scheduler controls the degree of multiprogramming. Long term scheduler should select a good process mix of processes to better the system performance. It is also called as job scheduling.
  • 14. SHORT-TERM SCHEDULER: (or CPU scheduler) – selects which process should be executed next and allocates CPU. It selects a process from ready queue and gives the control of CPU to that process. Processes gets the CPU for a short time slice while the short time scheduler decides that which job well run next. Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 14
  • 15. Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 15 Medium Term Scheduling Time sharing OSs may introduce a medium term scheduler Removes processes from memory to reduce the degree of multiprogramming It swaps the process between memory and secondary storage. It improves the system by reducing the degree of multiprogramming. I/O-bound process – spends more time doing I/O than computations. CPU-bound process – spends more time doing computations.
  • 16. Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 16 Context Switch When the CPU switches to another process, an interrupt occurs. The system must save the state of the old process and load the saved state for the new process. Context-switch time is overhead; the system does no useful work while switching.
  • 17. Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 17 Process Creation Parent process create children processes which, in turn, create other processes forming a tree of processes. Each process is assigned a unique process identifier (pid) Resource sharing  Parent and children share all resources.  Children share subset of parent’s resources. Execution  Parent and children execute concurrently.  Parent waits until some or all of its children terminate.
  • 18. Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 18 Process Termination Process executes last statement and asks the operating system to delete it by using the exit  Time Slot finished  Process’ resources are deal located by operating system. Parent may terminate execution of children processes  Child has exceeded allocated resources.  Task assigned to child is no longer required.  Parent is exiting.  Some operating systems do not allow child to continue if its parent terminates
  • 19. Inter Process Communication An IPC is used to provide two operations of sending and receiving message. If two process wish two communicate with each other.  Establish a communication link between them.  Exchange messages using the send and receive operations.  To synchronize there actions Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 19
  • 20. Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 20 Direct Communication Processes must name each other explicitly (a disadvantage):  send (P, message) – send a message to process P  receive(Q, message) – receive a message from process Q Properties of communication link  Links are established automatically.  A link is associated with exactly one pair of communicating processes.  Between each pair there exists exactly one link.  The link may be unidirectional, but is usually bi-directional.  the print server.
  • 21. Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 21 Indirect Communication Messages are directed and received from mailboxes (also referred to as ports).  Each mailbox has a unique id.  Processes can communicate only if they share a mailbox. Properties of communication link  Link established only if processes share a common mailbox  A link may be associated with many processes.  Each pair of processes may share several communication links.  Link may be unidirectional or bi-directional.
  • 22. Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 22 Buffering(RAM) Whether the communication link is direct or indirect, messages exchanged by communicating processes resides in a temporary queue. e.g Copy, Paste Bounded capacity Unbounded capacity
  • 23. Silberschatz / OS Concepts / 6e - Chapter 4 Processes Slide 23