SlideShare a Scribd company logo
Operating Systems
Chapter 3: Processes
Lecturer: Dalya Samer
Operating System Concepts – 10th
Edition Silberschatz, Galvin and Gagne ©2018
Chapter 3 Outlines
▪ Process Concept
▪ Process Scheduling
▪ Operations on Processes
▪ Interprocess Communication
Operating System Concepts – 10
3.2 Silberschatz, Galvin and Gagne ©2018 th
Edition
Process Concept(1/2)
Program vs. Process
▪ A program is a passive entity such as the file that contains the
list of instructions stored on a disk always referred to as an
executable file.
▪ A program becomes a process when an executable file is
loaded into the memory and then becomes an active entity.
▪ The fundamental task of any operating system is the process
management.
▪ Processes include not only a text but also include a set of
resources such as open files and pending signals. Processes
also contain internal kernel data, processor state, an address
space, and a data section
Operating System Concepts – 10
3.3 Silberschatz, Galvin and Gagne ©2018 th
Edition
Process Concept(2/2)
➢OS must allocate resources to processes, enable sharing of
information, protect resources, and enable the synchronization
among processes.
Operating System Concepts – 10
3.4 Silberschatz, Galvin and Gagne ©2018 th
Edition
Process Elements (1/2)
▪ Segments of a process represents the following components:
➢ Text Section: the program code. This is typically read-only,
and might be shared by a number of processes.
➢ Data Section: containing global variables.
➢ Heap: containing memory dynamically allocated during run
time.
➢ Stack: containing temporary data.
• Function parameters, return addresses, local variables.
Operating System Concepts – 10
3.5 Silberschatz, Galvin and Gagne ©2018 th
Edition
Process Elements (2/2) •Process in
Memory
Operating System Concepts – 10
3.6 Silberschatz, Galvin and Gagne ©2018 th
Edition
Process Control Block (PCB) (1/2)
• For better control of processes,
operating
systems need to consider their dynamic
behaviors.
• Each process is represented in the OS by
a
Process Control Block (PCB).
Operating System Concepts – 10
3.7 Silberschatz, Galvin and Gagne ©2018 th
Edition
Process Control Block (PCB) (2/2)
❑Process Control Block (PCB) (1/3)
➢ Process identification information:
•Process identifier: numeric identifiers represent the
unique process identifier .
•User identifier: the user who is responsible for the job).
•Identifier of the parent process that created this
process.
Operating System Concepts – 10
3.8 Silberschatz, Galvin and Gagne ©2018 th
Edition
Process Control Block (PCB) (2/2)
❑Process Control Block (PCB) (2/3)
➢ Processor state Information
•Process state – running, waiting, etc
➢ Program counter
•location of instruction to next execute
➢ CPU registers
• contents of all process-centric registers
Operating System Concepts – 10
3.9 Silberschatz, Galvin and Gagne ©2018 th
Edition
Process Control Block (PCB) (2/2)
❑Process Control Block (PCB) (3/3)
➢ CPU scheduling information
▪ priorities, scheduling queue pointers
➢ Memory-management information
▪ memory allocated to the process
➢Accounting information
▪ CPU used, clock time elapsed since start, time limits
➢ I/O status information
▪ I/O devices allocated to
process, list of open files
Operating System Concepts – 10
3.10 Silberschatz, Galvin and Gagne ©2018 th
Edition
Process State (1/3)
▪ As a process executes, it changes state
➢New: The process is being created
➢Running: Instructions are being executed
➢Waiting: The process is waiting for some event to
occur
➢Ready: The process is waiting to be assigned to a
processor
➢Terminated: The process has finished execution
Operating System Concepts – 10
3.11 Silberschatz, Galvin and Gagne ©2018 th
Edition
Process State (2/3)
•Diagram of Process State
Operating System Concepts – 10
3.12 Silberschatz, Galvin and Gagne ©2018 th
Edition
Process State (3/3)
Operating System Concepts – 10
3.13 Silberschatz, Galvin and Gagne ©2018 th
Edition
Process State (3/3)
Operating System Concepts – 10
3.14 Silberschatz, Galvin and Gagne ©2018 th
Edition
Process State (3/3)
Operating System Concepts – 10
3.15 Silberschatz, Galvin and Gagne ©2018 th
Edition
Process State (3/3)
Operating System Concepts – 10
3.16 Silberschatz, Galvin and Gagne ©2018 th
Edition
Process State (3/3)
Operating System Concepts – 10
3.17 Silberschatz, Galvin and Gagne ©2018 th
Edition
Process State (3/3)
Operating System Concepts – 10
3.18 Silberschatz, Galvin and Gagne ©2018 th
Edition
CPU Switch From Process to
Process
Operating System Concepts – 10
3.19 Silberschatz, Galvin and Gagne ©2018 th
Edition
Process Scheduling (1/2) ▪ 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
• Processes migrate among the various queues
Operating System Concepts – 10
3.20 Silberschatz, Galvin and Gagne ©2018 th
Edition
Process Scheduling (2/2)
•Representation of Process Scheduling
Operating System Concepts – 10
3.21 Silberschatz, Galvin and Gagne ©2018 th
Edition
Schedulers (1/2)
▪ Short-term scheduler (or CPU scheduler)
➢ Selects which process should be executed next and
allocates CPU.
➢ Invoked frequently (milliseconds) → (must be fast).
▪ Long-term scheduler (or job scheduler)
➢ Selects which processes should be brought into the ready
queue.
➢ Invoked infrequently (seconds, minutes) → (may be
slow).
➢ Controls the degree of multiprogramming.
Operating System Concepts – 10
3.22 Silberschatz, Galvin and Gagne ©2018 th
Edition
Schedulers (2/2)
▪ Medium-term scheduler
➢ Can be added if degree of multiple programming needs to
decrease
➢ Remove process from memory, store on disk, bring back
in from disk to continue execution: swapping
Operating System Concepts – 10
3.23 Silberschatz, Galvin and Gagne ©2018 th
Edition
Interprocess Communication(1/2)
▪ Processes within a system may be independent or cooperating ▪
Cooperating process can affect or be affected by other processes,
including sharing data
▪ Cooperating processes need interprocess communication (IPC)
▪ Two models of IPC
➢Shared memory
➢Message passing
Operating System Concepts – 10
3.24 Silberschatz, Galvin and Gagne ©2018 th
Edition
Interprocess Communication(2/2)
(a) Shared memory. (b) Message passing.
Operating System Concepts – 10
3.25 Silberschatz, Galvin and Gagne ©2018 th
Edition
End of Chapter 3
Operating System Concepts – 10th
Edition Silberschatz, Galvin and Gagne ©2018

More Related Content

PPT
Module-2 presentation.ppt of embedded system
PPT
Unit 2 chapter notes for the student1-1.ppt
PPTX
OS_Process_Management_Chap4.pptx
PPTX
ch3_LU6_LU7_Lecture_1691052564579.pptx
PPT
OS-operating systems- ch03
PPTX
Week03-Ch3-Process Concept.pptx.gfhgvjhg
PPTX
ch3-lect7.pptx
PDF
os-ch03.pdfEGERGQEGQERGQEGQERGQERGQERGQERG
Module-2 presentation.ppt of embedded system
Unit 2 chapter notes for the student1-1.ppt
OS_Process_Management_Chap4.pptx
ch3_LU6_LU7_Lecture_1691052564579.pptx
OS-operating systems- ch03
Week03-Ch3-Process Concept.pptx.gfhgvjhg
ch3-lect7.pptx
os-ch03.pdfEGERGQEGQERGQEGQERGQERGQERGQERG

Similar to Processes, Process Control Block, Process Scheduling.pdf (20)

PPTX
OS UNIT-II-PPT.pptx-operating systems complete notes
PPT
Chapter 3
PPTX
ch3.pptx
PPTX
Processes
PPTX
Operating systems Week 3 Processes 01-10-2018.pptx
PPTX
Chapter 3 Processes (1)Operating systems.pptx
PPTX
ch3.pptx
PPTX
ch03.pptx
PPT
process management.ppt
PPT
ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 c...
PPT
ch3.ppt
PPT
Lecture_Process.ppt
PPTX
cs8493 - operating systems unit 2
PPT
ch3 (1).ppt
PPT
PPT
ch3 s ppt
PPT
ch3.ppt
PPT
Operating System
PPT
Processes
PPT
Chapter 3-Processes userd in operating sys.ppt
OS UNIT-II-PPT.pptx-operating systems complete notes
Chapter 3
ch3.pptx
Processes
Operating systems Week 3 Processes 01-10-2018.pptx
Chapter 3 Processes (1)Operating systems.pptx
ch3.pptx
ch03.pptx
process management.ppt
ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 ch3 c...
ch3.ppt
Lecture_Process.ppt
cs8493 - operating systems unit 2
ch3 (1).ppt
ch3 s ppt
ch3.ppt
Operating System
Processes
Chapter 3-Processes userd in operating sys.ppt
Ad

Recently uploaded (20)

PPTX
Introduction to Inferential Statistics.pptx
PDF
Microsoft Core Cloud Services powerpoint
PPTX
STERILIZATION AND DISINFECTION-1.ppthhhbx
PDF
Data Engineering Interview Questions & Answers Cloud Data Stacks (AWS, Azure,...
PPTX
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
PPT
Predictive modeling basics in data cleaning process
PPT
ISS -ESG Data flows What is ESG and HowHow
PDF
OneRead_20250728_1808.pdfhdhddhshahwhwwjjaaja
PDF
[EN] Industrial Machine Downtime Prediction
PPTX
A Complete Guide to Streamlining Business Processes
PDF
Introduction to the R Programming Language
PDF
Optimise Shopper Experiences with a Strong Data Estate.pdf
PDF
Introduction to Data Science and Data Analysis
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PPTX
IMPACT OF LANDSLIDE.....................
PPTX
New ISO 27001_2022 standard and the changes
DOCX
Factor Analysis Word Document Presentation
PPTX
Leprosy and NLEP programme community medicine
PDF
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
PPTX
IBA_Chapter_11_Slides_Final_Accessible.pptx
Introduction to Inferential Statistics.pptx
Microsoft Core Cloud Services powerpoint
STERILIZATION AND DISINFECTION-1.ppthhhbx
Data Engineering Interview Questions & Answers Cloud Data Stacks (AWS, Azure,...
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
Predictive modeling basics in data cleaning process
ISS -ESG Data flows What is ESG and HowHow
OneRead_20250728_1808.pdfhdhddhshahwhwwjjaaja
[EN] Industrial Machine Downtime Prediction
A Complete Guide to Streamlining Business Processes
Introduction to the R Programming Language
Optimise Shopper Experiences with a Strong Data Estate.pdf
Introduction to Data Science and Data Analysis
Acceptance and paychological effects of mandatory extra coach I classes.pptx
IMPACT OF LANDSLIDE.....................
New ISO 27001_2022 standard and the changes
Factor Analysis Word Document Presentation
Leprosy and NLEP programme community medicine
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
IBA_Chapter_11_Slides_Final_Accessible.pptx
Ad

Processes, Process Control Block, Process Scheduling.pdf

  • 1. Operating Systems Chapter 3: Processes Lecturer: Dalya Samer Operating System Concepts – 10th Edition Silberschatz, Galvin and Gagne ©2018 Chapter 3 Outlines
  • 2. ▪ Process Concept ▪ Process Scheduling ▪ Operations on Processes ▪ Interprocess Communication Operating System Concepts – 10 3.2 Silberschatz, Galvin and Gagne ©2018 th Edition
  • 3. Process Concept(1/2) Program vs. Process ▪ A program is a passive entity such as the file that contains the list of instructions stored on a disk always referred to as an executable file. ▪ A program becomes a process when an executable file is loaded into the memory and then becomes an active entity. ▪ The fundamental task of any operating system is the process management. ▪ Processes include not only a text but also include a set of resources such as open files and pending signals. Processes also contain internal kernel data, processor state, an address space, and a data section
  • 4. Operating System Concepts – 10 3.3 Silberschatz, Galvin and Gagne ©2018 th Edition Process Concept(2/2) ➢OS must allocate resources to processes, enable sharing of information, protect resources, and enable the synchronization among processes.
  • 5. Operating System Concepts – 10 3.4 Silberschatz, Galvin and Gagne ©2018 th Edition Process Elements (1/2) ▪ Segments of a process represents the following components: ➢ Text Section: the program code. This is typically read-only, and might be shared by a number of processes. ➢ Data Section: containing global variables. ➢ Heap: containing memory dynamically allocated during run time. ➢ Stack: containing temporary data. • Function parameters, return addresses, local variables.
  • 6. Operating System Concepts – 10 3.5 Silberschatz, Galvin and Gagne ©2018 th Edition Process Elements (2/2) •Process in
  • 7. Memory Operating System Concepts – 10 3.6 Silberschatz, Galvin and Gagne ©2018 th Edition Process Control Block (PCB) (1/2)
  • 8. • For better control of processes, operating systems need to consider their dynamic behaviors. • Each process is represented in the OS by a Process Control Block (PCB). Operating System Concepts – 10 3.7 Silberschatz, Galvin and Gagne ©2018 th Edition
  • 9. Process Control Block (PCB) (2/2) ❑Process Control Block (PCB) (1/3) ➢ Process identification information: •Process identifier: numeric identifiers represent the unique process identifier . •User identifier: the user who is responsible for the job). •Identifier of the parent process that created this process.
  • 10. Operating System Concepts – 10 3.8 Silberschatz, Galvin and Gagne ©2018 th Edition Process Control Block (PCB) (2/2) ❑Process Control Block (PCB) (2/3) ➢ Processor state Information •Process state – running, waiting, etc ➢ Program counter •location of instruction to next execute
  • 11. ➢ CPU registers • contents of all process-centric registers Operating System Concepts – 10 3.9 Silberschatz, Galvin and Gagne ©2018 th Edition Process Control Block (PCB) (2/2) ❑Process Control Block (PCB) (3/3) ➢ CPU scheduling information ▪ priorities, scheduling queue pointers ➢ Memory-management information ▪ memory allocated to the process
  • 12. ➢Accounting information ▪ CPU used, clock time elapsed since start, time limits ➢ I/O status information ▪ I/O devices allocated to process, list of open files Operating System Concepts – 10 3.10 Silberschatz, Galvin and Gagne ©2018 th Edition Process State (1/3) ▪ As a process executes, it changes state ➢New: The process is being created ➢Running: Instructions are being executed
  • 13. ➢Waiting: The process is waiting for some event to occur ➢Ready: The process is waiting to be assigned to a processor ➢Terminated: The process has finished execution Operating System Concepts – 10 3.11 Silberschatz, Galvin and Gagne ©2018 th Edition Process State (2/3) •Diagram of Process State
  • 14. Operating System Concepts – 10 3.12 Silberschatz, Galvin and Gagne ©2018 th Edition Process State (3/3)
  • 15. Operating System Concepts – 10 3.13 Silberschatz, Galvin and Gagne ©2018 th Edition Process State (3/3)
  • 16. Operating System Concepts – 10 3.14 Silberschatz, Galvin and Gagne ©2018 th Edition Process State (3/3)
  • 17. Operating System Concepts – 10 3.15 Silberschatz, Galvin and Gagne ©2018 th Edition Process State (3/3)
  • 18. Operating System Concepts – 10 3.16 Silberschatz, Galvin and Gagne ©2018 th Edition Process State (3/3)
  • 19. Operating System Concepts – 10 3.17 Silberschatz, Galvin and Gagne ©2018 th Edition
  • 21. Operating System Concepts – 10 3.18 Silberschatz, Galvin and Gagne ©2018 th Edition CPU Switch From Process to Process
  • 22. Operating System Concepts – 10 3.19 Silberschatz, Galvin and Gagne ©2018 th Edition Process Scheduling (1/2) ▪ 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 • Processes migrate among the various queues
  • 23. Operating System Concepts – 10 3.20 Silberschatz, Galvin and Gagne ©2018 th Edition Process Scheduling (2/2) •Representation of Process Scheduling
  • 24. Operating System Concepts – 10 3.21 Silberschatz, Galvin and Gagne ©2018 th Edition Schedulers (1/2)
  • 25. ▪ Short-term scheduler (or CPU scheduler) ➢ Selects which process should be executed next and allocates CPU. ➢ Invoked frequently (milliseconds) → (must be fast). ▪ Long-term scheduler (or job scheduler) ➢ Selects which processes should be brought into the ready queue. ➢ Invoked infrequently (seconds, minutes) → (may be slow). ➢ Controls the degree of multiprogramming. Operating System Concepts – 10 3.22 Silberschatz, Galvin and Gagne ©2018 th Edition
  • 26. Schedulers (2/2) ▪ Medium-term scheduler ➢ Can be added if degree of multiple programming needs to decrease ➢ Remove process from memory, store on disk, bring back in from disk to continue execution: swapping
  • 27. Operating System Concepts – 10 3.23 Silberschatz, Galvin and Gagne ©2018 th Edition Interprocess Communication(1/2) ▪ Processes within a system may be independent or cooperating ▪ Cooperating process can affect or be affected by other processes, including sharing data ▪ Cooperating processes need interprocess communication (IPC) ▪ Two models of IPC ➢Shared memory ➢Message passing
  • 28. Operating System Concepts – 10 3.24 Silberschatz, Galvin and Gagne ©2018 th Edition Interprocess Communication(2/2) (a) Shared memory. (b) Message passing.
  • 29. Operating System Concepts – 10 3.25 Silberschatz, Galvin and Gagne ©2018 th Edition End of Chapter 3
  • 30. Operating System Concepts – 10th Edition Silberschatz, Galvin and Gagne ©2018