SlideShare a Scribd company logo
1 of 36
Process creation and termination
Agenda of Lecture
• Why and how process are created
• Resource Sharing
• Execution
• Address Space
• System Calls
Process Creation
• Tree Hierarchy
Question: When a child Process is created ,
whether the child process will share info with
their parent process and how its execution
might be?
Resource Sharing
They may settle three arrangements
1. Parent and children share all resources
2. Child and parent share subset of resources
3. They may share no resources
Execution
Parent has created a child Process how their
execution will go on
1. Parent stops waiting for child to finish itself
2. Either they perform simultaneously
3. Either parents end and child continues
Unix & Linux
Unix / Linux Parent and child Process
Question: If they both look the same and usually
if both the process of the same are running
what will be the need of it to run?
Unix & Linux ( Parent –Child)
System calls:
Fork() To create a child Process
Exit() To terminate a child Process
Wait() Parent Process wait for a child
Process
Exec() Process overwrites itself with
another executable program
Process Tree in Unix
Process Termination
Reasons:
• The allocated resources to the child has been
exceeded
• Parent Process has created lots of child
Process
• Child Process was created for a purpose
whose task is completed
System Calls ……
• Fork()
When the fork system call is executed a new
process is created which consist of copy of the
parent process
The mechanism allows parent process to
communicate easily with the child
Synopsis:
#include <sys/types.h>
#include<unistd.h>
Pid_ t fork(void)
Wait()
• A process created a child process , process
calls wait(), until a child process is terminated
the parent process will remain in waiting
state.
• Synopsis for wait system call
#include <sys/types.h>
#include <sys/wait.h>
pid_t wait(int *stat_loc);
Exec()
• A process that calls EXEC() it will overwrite
itself with another executable
• There is no return value
• Synopsis of execlp() is given as
• #include <unistd.h>
• int execlp (const char *file, const,char *arg0,
...,const char *argn,(char *)Null);
Sample Code
Cooperating Processes
Advantages of Cooperating Process
• Information Sharing
• Computation speedup
• Modularity
Producer Consumer Problem
• Over view of the Problem
We may have processes which produce
something, we place them some where
(file/main memory) and then there are
processes who will consume these things .
The place where these items are placed can be
bounded on unbounded
Bounded Buffer consumer problem
• We call space a buffer which is bounded.
• Process that creates an item place it in an
array slot called producer process
• Process that consume the created item is
called consumer problem
Buffer
• Buffer can be filled and empty .
If producer produce item at faster rate then
consumer consumption then it may get full. In
this case if the producer another item then it
will have to wait
If the buffer is empty then the consumer is
consuming at faster rate then producing so
then the consumer will have to wait.
General Problem Description
• We have fixed size buffer ,two processes(
Producer and Consumer ) .Producer produce
the item. Place it in the right full place in the
buffer updates the index variable for the next
item to place. Similarly index maintain the
index variable which points to the next item to
be consumed.
Semantics of the problem
Solution of the Problem
Inter Process Communication
• The agenda is based on parent and child
process communication.
• Channels required for communication
• Properties of channels for different
communication
• System calls ( Read and write )
Operation for IPC
• Operation Send
A process will send something to another
process
• Operation Receive
A process will receive something form the
sender process
Message that is sent may be unlimited or
bounded in terms of bytes
Communication means
1. Direct Communication
2. Indirect Communication
Communication Channels
• Provide medium of communication
• Both communication means employ medium of
communication
• Few question to understand………
a) How the channels are establish?
b) How we may link two processes
c) How many channels a cooperating process
have?
d) What is the capacity of the channels?
e) Is the link is bidirectional or unidirectional?
Direct Communication
• In direct Communication links are establish
automatically
• Between each pair there would be one link
• Link may be unidirectional or bidirectional
Name of the process
Message
Indirect Communication
• Sender or receiver doesn’t name to sender
process or receiver process and vice versa
• Example Mail Box
• It is only possible if the process share the
same mail box ( Channel)
Issues with indirect communication
• We have three processes P1, P2 and P3.P1
sends a message and P2,P3 are the receiver.
Which Process will receive the message?
Solutions
Process Synchronization
Channels capacity

More Related Content

What's hot

Operating system 11 system calls
Operating system 11 system callsOperating system 11 system calls
Operating system 11 system callsVaibhav Khanna
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process SchedulingShipra Swati
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)Prakhar Maurya
 
contiguous memory allocation.pptx
contiguous memory allocation.pptxcontiguous memory allocation.pptx
contiguous memory allocation.pptxRajapriya82
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentationusmankiyani1
 
cpu scheduling
cpu schedulingcpu scheduling
cpu schedulinghashim102
 
General purpose simulation System (GPSS)
General purpose simulation System (GPSS)General purpose simulation System (GPSS)
General purpose simulation System (GPSS)Tushar Aneyrao
 
Multiprogramming&timesharing
Multiprogramming&timesharingMultiprogramming&timesharing
Multiprogramming&timesharingTanuj Tyagi
 
Operating system services 9
Operating system services 9Operating system services 9
Operating system services 9myrajendra
 
Multithreading computer architecture
 Multithreading computer architecture  Multithreading computer architecture
Multithreading computer architecture Haris456
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Mukesh Chinta
 
Pipeline hazard
Pipeline hazardPipeline hazard
Pipeline hazardAJAL A J
 
Kernel I/O subsystem
Kernel I/O subsystemKernel I/O subsystem
Kernel I/O subsystemAtiKa Bhatti
 
Process management os concept
Process management os conceptProcess management os concept
Process management os conceptpriyadeosarkar91
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed systemSunita Sahu
 

What's hot (20)

Operating system 11 system calls
Operating system 11 system callsOperating system 11 system calls
Operating system 11 system calls
 
CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process Scheduling
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
 
Shortest Job First
Shortest Job FirstShortest Job First
Shortest Job First
 
BANKER'S ALGORITHM
BANKER'S ALGORITHMBANKER'S ALGORITHM
BANKER'S ALGORITHM
 
contiguous memory allocation.pptx
contiguous memory allocation.pptxcontiguous memory allocation.pptx
contiguous memory allocation.pptx
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
cpu scheduling
cpu schedulingcpu scheduling
cpu scheduling
 
General purpose simulation System (GPSS)
General purpose simulation System (GPSS)General purpose simulation System (GPSS)
General purpose simulation System (GPSS)
 
Multiprogramming&timesharing
Multiprogramming&timesharingMultiprogramming&timesharing
Multiprogramming&timesharing
 
Operating system services 9
Operating system services 9Operating system services 9
Operating system services 9
 
Multithreading computer architecture
 Multithreading computer architecture  Multithreading computer architecture
Multithreading computer architecture
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)
 
Pipeline hazard
Pipeline hazardPipeline hazard
Pipeline hazard
 
Kernel I/O subsystem
Kernel I/O subsystemKernel I/O subsystem
Kernel I/O subsystem
 
Process management os concept
Process management os conceptProcess management os concept
Process management os concept
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
 

Viewers also liked

What is-a-computer-process-os
What is-a-computer-process-osWhat is-a-computer-process-os
What is-a-computer-process-osManish Singh
 
Operating system - Process and its concepts
Operating system - Process and its conceptsOperating system - Process and its concepts
Operating system - Process and its conceptsKaran Thakkar
 
Processes Control Block (Operating System)
Processes Control Block (Operating System)Processes Control Block (Operating System)
Processes Control Block (Operating System)Imdad Ullah
 
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating SystemRaj Mohan
 
Operating System
Operating SystemOperating System
Operating Systemguest8b0942
 
Process, Threads, Symmetric Multiprocessing and Microkernels in Operating System
Process, Threads, Symmetric Multiprocessing and Microkernels in Operating SystemProcess, Threads, Symmetric Multiprocessing and Microkernels in Operating System
Process, Threads, Symmetric Multiprocessing and Microkernels in Operating SystemLieYah Daliah
 
Code4vn linux day1 operating system concept
Code4vn linux day1 operating system conceptCode4vn linux day1 operating system concept
Code4vn linux day1 operating system conceptCường Nguyễn
 
Linked allocation 48
Linked  allocation 48Linked  allocation 48
Linked allocation 48myrajendra
 
5. spooling and buffering
5. spooling and buffering 5. spooling and buffering
5. spooling and buffering myrajendra
 
Index allocation 48 1
Index allocation 48 1Index allocation 48 1
Index allocation 48 1myrajendra
 
Allocation methods continuous method.47
Allocation methods continuous method.47 Allocation methods continuous method.47
Allocation methods continuous method.47 myrajendra
 
Termination
TerminationTermination
TerminationRoi Xcel
 

Viewers also liked (20)

What is-a-computer-process-os
What is-a-computer-process-osWhat is-a-computer-process-os
What is-a-computer-process-os
 
Operating system - Process and its concepts
Operating system - Process and its conceptsOperating system - Process and its concepts
Operating system - Process and its concepts
 
Processes Control Block (Operating System)
Processes Control Block (Operating System)Processes Control Block (Operating System)
Processes Control Block (Operating System)
 
Processes
ProcessesProcesses
Processes
 
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating System
 
Operating System
Operating SystemOperating System
Operating System
 
Sistemas operativos; procesos
Sistemas operativos; procesosSistemas operativos; procesos
Sistemas operativos; procesos
 
Process, Threads, Symmetric Multiprocessing and Microkernels in Operating System
Process, Threads, Symmetric Multiprocessing and Microkernels in Operating SystemProcess, Threads, Symmetric Multiprocessing and Microkernels in Operating System
Process, Threads, Symmetric Multiprocessing and Microkernels in Operating System
 
Credit creation
Credit creationCredit creation
Credit creation
 
Lesson 7 Process Control Block
Lesson 7 Process Control BlockLesson 7 Process Control Block
Lesson 7 Process Control Block
 
Dual-core processor
Dual-core processorDual-core processor
Dual-core processor
 
I/O Buffering
I/O BufferingI/O Buffering
I/O Buffering
 
Code4vn linux day1 operating system concept
Code4vn linux day1 operating system conceptCode4vn linux day1 operating system concept
Code4vn linux day1 operating system concept
 
Process of operating system
Process of operating systemProcess of operating system
Process of operating system
 
Linked allocation 48
Linked  allocation 48Linked  allocation 48
Linked allocation 48
 
5. spooling and buffering
5. spooling and buffering 5. spooling and buffering
5. spooling and buffering
 
An Introduction To Linux
An Introduction To LinuxAn Introduction To Linux
An Introduction To Linux
 
Index allocation 48 1
Index allocation 48 1Index allocation 48 1
Index allocation 48 1
 
Allocation methods continuous method.47
Allocation methods continuous method.47 Allocation methods continuous method.47
Allocation methods continuous method.47
 
Termination
TerminationTermination
Termination
 

Similar to Process creation and termination In Operating System

Similar to Process creation and termination In Operating System (20)

Lecture_3-Process Management.pdf
Lecture_3-Process Management.pdfLecture_3-Process Management.pdf
Lecture_3-Process Management.pdf
 
3 processes
3 processes3 processes
3 processes
 
Ch3
Ch3Ch3
Ch3
 
Ch4
Ch4Ch4
Ch4
 
9 cm402.13
9 cm402.139 cm402.13
9 cm402.13
 
Ch03
Ch03Ch03
Ch03
 
Course 102: Lecture 18: Process Life Cycle
Course 102: Lecture 18: Process Life CycleCourse 102: Lecture 18: Process Life Cycle
Course 102: Lecture 18: Process Life Cycle
 
Lect3 process
Lect3 processLect3 process
Lect3 process
 
Ch4 OS
Ch4 OSCh4 OS
Ch4 OS
 
OS_Ch4
OS_Ch4OS_Ch4
OS_Ch4
 
Process
ProcessProcess
Process
 
OSCh4
OSCh4OSCh4
OSCh4
 
Ch03 processes
Ch03 processesCh03 processes
Ch03 processes
 
Processes
ProcessesProcesses
Processes
 
3 process management
3 process management3 process management
3 process management
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentation
 
Ch3 processes
Ch3   processesCh3   processes
Ch3 processes
 
Module-6 process managedf;jsovj;ksdv;sdkvnksdnvldknvlkdfsment.ppt
Module-6 process managedf;jsovj;ksdv;sdkvnksdnvldknvlkdfsment.pptModule-6 process managedf;jsovj;ksdv;sdkvnksdnvldknvlkdfsment.ppt
Module-6 process managedf;jsovj;ksdv;sdkvnksdnvldknvlkdfsment.ppt
 
Chapter 1: Introduction to Unix / Linux Kernel
Chapter 1: Introduction to Unix / Linux KernelChapter 1: Introduction to Unix / Linux Kernel
Chapter 1: Introduction to Unix / Linux Kernel
 
CH03.pdf
CH03.pdfCH03.pdf
CH03.pdf
 

Recently uploaded

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 

Recently uploaded (20)

Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 

Process creation and termination In Operating System

  • 1. Process creation and termination Agenda of Lecture • Why and how process are created • Resource Sharing • Execution • Address Space • System Calls
  • 2. Process Creation • Tree Hierarchy Question: When a child Process is created , whether the child process will share info with their parent process and how its execution might be?
  • 3. Resource Sharing They may settle three arrangements 1. Parent and children share all resources 2. Child and parent share subset of resources 3. They may share no resources
  • 4. Execution Parent has created a child Process how their execution will go on 1. Parent stops waiting for child to finish itself 2. Either they perform simultaneously 3. Either parents end and child continues
  • 5. Unix & Linux Unix / Linux Parent and child Process Question: If they both look the same and usually if both the process of the same are running what will be the need of it to run?
  • 6. Unix & Linux ( Parent –Child) System calls: Fork() To create a child Process Exit() To terminate a child Process Wait() Parent Process wait for a child Process Exec() Process overwrites itself with another executable program
  • 8. Process Termination Reasons: • The allocated resources to the child has been exceeded • Parent Process has created lots of child Process • Child Process was created for a purpose whose task is completed
  • 9. System Calls …… • Fork() When the fork system call is executed a new process is created which consist of copy of the parent process The mechanism allows parent process to communicate easily with the child Synopsis: #include <sys/types.h> #include<unistd.h> Pid_ t fork(void)
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17. Wait() • A process created a child process , process calls wait(), until a child process is terminated the parent process will remain in waiting state. • Synopsis for wait system call #include <sys/types.h> #include <sys/wait.h> pid_t wait(int *stat_loc);
  • 18. Exec() • A process that calls EXEC() it will overwrite itself with another executable • There is no return value • Synopsis of execlp() is given as • #include <unistd.h> • int execlp (const char *file, const,char *arg0, ...,const char *argn,(char *)Null);
  • 20. Cooperating Processes Advantages of Cooperating Process • Information Sharing • Computation speedup • Modularity
  • 21. Producer Consumer Problem • Over view of the Problem We may have processes which produce something, we place them some where (file/main memory) and then there are processes who will consume these things . The place where these items are placed can be bounded on unbounded
  • 22. Bounded Buffer consumer problem • We call space a buffer which is bounded. • Process that creates an item place it in an array slot called producer process • Process that consume the created item is called consumer problem
  • 23. Buffer • Buffer can be filled and empty . If producer produce item at faster rate then consumer consumption then it may get full. In this case if the producer another item then it will have to wait If the buffer is empty then the consumer is consuming at faster rate then producing so then the consumer will have to wait.
  • 24. General Problem Description • We have fixed size buffer ,two processes( Producer and Consumer ) .Producer produce the item. Place it in the right full place in the buffer updates the index variable for the next item to place. Similarly index maintain the index variable which points to the next item to be consumed.
  • 25. Semantics of the problem
  • 26. Solution of the Problem
  • 27. Inter Process Communication • The agenda is based on parent and child process communication. • Channels required for communication • Properties of channels for different communication • System calls ( Read and write )
  • 28. Operation for IPC • Operation Send A process will send something to another process • Operation Receive A process will receive something form the sender process Message that is sent may be unlimited or bounded in terms of bytes
  • 29. Communication means 1. Direct Communication 2. Indirect Communication
  • 30. Communication Channels • Provide medium of communication • Both communication means employ medium of communication • Few question to understand……… a) How the channels are establish? b) How we may link two processes c) How many channels a cooperating process have? d) What is the capacity of the channels? e) Is the link is bidirectional or unidirectional?
  • 31. Direct Communication • In direct Communication links are establish automatically • Between each pair there would be one link • Link may be unidirectional or bidirectional Name of the process Message
  • 32. Indirect Communication • Sender or receiver doesn’t name to sender process or receiver process and vice versa • Example Mail Box • It is only possible if the process share the same mail box ( Channel)
  • 33. Issues with indirect communication • We have three processes P1, P2 and P3.P1 sends a message and P2,P3 are the receiver. Which Process will receive the message?

Editor's Notes

  1. When the linux is booted the first process that is created is init Process. After creating init Process by using fork system call multiple Process are run.The running Process provides user certain use as per system requirements. All the system Processess that run in the background to provide services to the user are called demon. ( Printer demon, Page demon)
  2. Kernel Reaction to the failure: Error Number
  3. Zombie Process:
  4. The default directory in which this header file reside : /user/include/sys/ The wait system call require an integer pointer what it returns is a type of PID _ t
  5. Whenever the exec is called the last argument will be Null pointer Char pointer file: path name of the executable that needs to be over written Arg 0: last component of the file name ~/courses/cs604/program/prog.1 Arg 1-N: contents of command line until it hits the null pointer
  6. /bin/ls : absolute name of the executable that we like to over write by this current process .
  7. In solution II the problem arise of Process synchronization
  8. For Send and receive in various operating system we have read and write system calls.