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 (20)

Peterson Critical Section Problem Solution
Peterson Critical Section Problem SolutionPeterson Critical Section Problem Solution
Peterson Critical Section Problem Solution
 
process creation OS
process creation OSprocess creation OS
process creation OS
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
Basics of Operating System
Basics of Operating SystemBasics of Operating System
Basics of Operating System
 
Chapter 7 - Deadlocks
Chapter 7 - DeadlocksChapter 7 - Deadlocks
Chapter 7 - Deadlocks
 
5 Process Scheduling
5 Process Scheduling5 Process Scheduling
5 Process Scheduling
 
operating system structure
operating system structureoperating system structure
operating system structure
 
Process in operating system
Process in operating systemProcess in operating system
Process in operating system
 
Cs8493 unit 2
Cs8493 unit 2Cs8493 unit 2
Cs8493 unit 2
 
Communication in Distributed Systems
Communication in Distributed SystemsCommunication in Distributed Systems
Communication in Distributed Systems
 
Scheduling
SchedulingScheduling
Scheduling
 
Processes and threads
Processes and threadsProcesses and threads
Processes and threads
 
Operating systems system structures
Operating systems   system structuresOperating systems   system structures
Operating systems system structures
 
Chapter 3 - Processes
Chapter 3 - ProcessesChapter 3 - Processes
Chapter 3 - Processes
 
Process threads operating system.
Process threads operating system.Process threads operating system.
Process threads operating system.
 
Chapter 14 - Protection
Chapter 14 - ProtectionChapter 14 - Protection
Chapter 14 - Protection
 
Process management in os
Process management in osProcess management in os
Process management in os
 
operating system lecture notes
operating system lecture notesoperating system lecture notes
operating system lecture notes
 
Naming in Distributed Systems
Naming in Distributed SystemsNaming in Distributed Systems
Naming in Distributed Systems
 

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

EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
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.
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 

Recently uploaded (20)

EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
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
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 

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.