SlideShare a Scribd company logo
processes
OUTLINE
 Process Concept
 Process Scheduling
 Operations on Processes
 Inter-process Communication
 Examples of IPC Systems
 Communication in Client-Server Systems
Fork( ) ?
Fork( ) ?
Fork( ) ?
Fork( ) ?
Fork( ) ?
Fork( ) ?
Fork( ) ?
Fork( ) ?
Process creation
 A process may create several processes during the execution.
 Creating process is called a parent and a created process is called a
child.
 Parent process create children process, which, in turn create other
processes, forming a tree of processes
 Generally, process identified and managed via a process identifier (pid)
Process creation: fork()
 Creates a child process.
 Child process contains exact copy of the memory space of the parent
process.
 Child process contains the same text/code section but executes
independently
Exec()
 Exec is a collection of function e.g., execlp(), ececve(), execl(), are use to
execute any program/script.
 Typically exec used after a fork() by child process to replace the memory
space with a new program.
 PID does not change but the data, heap, and stack of the child are
replace by new program
Process creation (cont..)
 Fork( ) system call creates new process
 Exec( ) system call used after fork to replace the process memory space
with a new program.
Process Termination
 Process executes last statement and asks the operating system to delete it
(exit)
 Process resources are deallocated by operating system
 Parent may terminate execution of children processes (abort).
 Task assigned to child is no longer required
 If parent is exiting
o Some operating system do not allow to continue if its parent
terminates
o All children terminated – cascading termination.
15
Execution Trace: fork()
RAM
CPU
Kernel
stack
data
text
….
n=fork();
If (n == 0)
..
else if (n>0)
...
PC
PCB-Parent
Process-Parent
x pid
PC
n
sys_fork()
{….}
PC
y pid
PCB-Child
text
Process-Child
n
stack
data
….
n=fork();
If (n == 0)
..
else if (n>0)
...
y 0
16
Execution Trace: fork() with execlp()
RAM
CPU
Kernel
stack
data
text
….
n=fork();
If (n == 0)
…exec()
else if (n>0)
...
PC
PCB-Parent
Process-Parent
x pid
PC
n
sys_fork()
{….}
PC
y pid
PCB-Child
text
Process-Child
n
stack
data
….
n=fork();
If (n == 0)
…exec()
else if (n>0)
...
y 0
sys_execve()
{….}
new code

More Related Content

PDF
Lecture_3-Process Management.pdf
PPT
process creation OS
PDF
Operating System Lecture 4 on Different Topics
PPT
FORK SYSTEM CALL in the main concept.ppt
PPT
9 cm402.13
PPTX
operating system process management with example
PPT
What is-a-computer-process-os
Lecture_3-Process Management.pdf
process creation OS
Operating System Lecture 4 on Different Topics
FORK SYSTEM CALL in the main concept.ppt
9 cm402.13
operating system process management with example
What is-a-computer-process-os

Similar to Chapter3_ProcessConcept-Operation_on_Processes.pptx (20)

PPTX
Process management in operating system | process states | PCB | FORK() | Zomb...
PPT
Lect3 process
PPT
Lecture 8 9 process_concept
PPTX
unit 2- process management of Operating System
PPTX
Lecture_Slide_4.pptx
PPT
Ch2_Processes_and_process_management_1.ppt
PPTX
operating system module 2 presentation notes
PPTX
04_ForkPipe.pptx
PDF
Process management
PDF
Systems Programming Assignment Help - Processes
PPTX
OS - Chapter # 3 for the development of os
PDF
CH03.pdf
PDF
3 process management
PPTX
2Chapter Two- Process Management(2) (1).pptx
PPTX
System call (Fork +Exec)
PPTX
OS (1).pptx
PPTX
Operating system Chapter 3 Part-1 process and threads.pptx
PDF
process.pdfzljwiyrouyaeutoaetodtusiokklhh
DOC
computer notes - Inter process communication
PDF
System calls
Process management in operating system | process states | PCB | FORK() | Zomb...
Lect3 process
Lecture 8 9 process_concept
unit 2- process management of Operating System
Lecture_Slide_4.pptx
Ch2_Processes_and_process_management_1.ppt
operating system module 2 presentation notes
04_ForkPipe.pptx
Process management
Systems Programming Assignment Help - Processes
OS - Chapter # 3 for the development of os
CH03.pdf
3 process management
2Chapter Two- Process Management(2) (1).pptx
System call (Fork +Exec)
OS (1).pptx
Operating system Chapter 3 Part-1 process and threads.pptx
process.pdfzljwiyrouyaeutoaetodtusiokklhh
computer notes - Inter process communication
System calls
Ad

Recently uploaded (20)

PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Pharma ospi slides which help in ospi learning
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Business Ethics Teaching Materials for college
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PPTX
Cell Types and Its function , kingdom of life
Anesthesia in Laparoscopic Surgery in India
Microbial diseases, their pathogenesis and prophylaxis
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
human mycosis Human fungal infections are called human mycosis..pptx
Abdominal Access Techniques with Prof. Dr. R K Mishra
Pharma ospi slides which help in ospi learning
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Week 4 Term 3 Study Techniques revisited.pptx
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Business Ethics Teaching Materials for college
102 student loan defaulters named and shamed – Is someone you know on the list?
Microbial disease of the cardiovascular and lymphatic systems
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
TR - Agricultural Crops Production NC III.pdf
PPH.pptx obstetrics and gynecology in nursing
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Cell Types and Its function , kingdom of life
Ad

Chapter3_ProcessConcept-Operation_on_Processes.pptx

  • 1. processes OUTLINE  Process Concept  Process Scheduling  Operations on Processes  Inter-process Communication  Examples of IPC Systems  Communication in Client-Server Systems
  • 10. Process creation  A process may create several processes during the execution.  Creating process is called a parent and a created process is called a child.  Parent process create children process, which, in turn create other processes, forming a tree of processes  Generally, process identified and managed via a process identifier (pid)
  • 11. Process creation: fork()  Creates a child process.  Child process contains exact copy of the memory space of the parent process.  Child process contains the same text/code section but executes independently
  • 12. Exec()  Exec is a collection of function e.g., execlp(), ececve(), execl(), are use to execute any program/script.  Typically exec used after a fork() by child process to replace the memory space with a new program.  PID does not change but the data, heap, and stack of the child are replace by new program
  • 13. Process creation (cont..)  Fork( ) system call creates new process  Exec( ) system call used after fork to replace the process memory space with a new program.
  • 14. Process Termination  Process executes last statement and asks the operating system to delete it (exit)  Process resources are deallocated by operating system  Parent may terminate execution of children processes (abort).  Task assigned to child is no longer required  If parent is exiting o Some operating system do not allow to continue if its parent terminates o All children terminated – cascading termination.
  • 15. 15 Execution Trace: fork() RAM CPU Kernel stack data text …. n=fork(); If (n == 0) .. else if (n>0) ... PC PCB-Parent Process-Parent x pid PC n sys_fork() {….} PC y pid PCB-Child text Process-Child n stack data …. n=fork(); If (n == 0) .. else if (n>0) ... y 0
  • 16. 16 Execution Trace: fork() with execlp() RAM CPU Kernel stack data text …. n=fork(); If (n == 0) …exec() else if (n>0) ... PC PCB-Parent Process-Parent x pid PC n sys_fork() {….} PC y pid PCB-Child text Process-Child n stack data …. n=fork(); If (n == 0) …exec() else if (n>0) ... y 0 sys_execve() {….} new code