SlideShare une entreprise Scribd logo
1  sur  18
Understand Process Management
       • Relationship Between Processes




                                          1
Recap

In the last class, you have learnt
• Process Creation

• Process Termination


     HOME     PREVIOUS TOPIC
     NEXT
     PREVIOUS QUESTION PAPERS
     FOR OS
     CPP TUTORIALS
                     9CM402.14       2
Objectives


On completion of this class, you will be able to
  know

• Relationship between Processes

• Reasons for providing an environment that allows
  Process cooperation



                        9CM402.14                    3
Relationship Between Processes
• Concurrent processes executing in the operating system may be


 either “Independent processes” or “Cooperating processes”
• A process is independent if it cannot affect or be affected by the
 other processes executing in the system
• A process that does not share any data with any other process is
 independent Process
• A Process is a cooperating, if it can affect or be affected by the
 other processes executing in the system
• Any process that shares data with other processes is a
                            9CM402.14                           4
 cooperating process
Relationship Between Processes

Reasons for Process cooperation

• Information sharing

• Computation speedup

• Modularity

• Convenience



                        9CM402.14         5
Relationship Between Processes
Information Sharing
• Several users may be interested in same piece of information,
  Ex. Shared file
• Must provide an environment to allow concurrent access to
  these types of resources
Computation Speedup
• To run a particular task faster, we must break it into subtasks
• Each of the subtask will execute in parallel with others
• This is possible only if computer has multiple processing
  elements ( CPU or I/O channels)
                             9CM402.14                         6
Relationship Between Processes

Modularity:
• For cooperating between systems we have to construct the
  system in a modular fashion
• Dividing the system function into separate processes or
  threads
Convenience:
• Even an individual user may work on many tasks at the same
  time
• For instance, a user may be editing, printing and compiling in
  parallel


                             9CM402.14                         7
Cooperating Processors

• Concurrent execution that requires cooperation among the
  processes requires mechanisms to allow processes
  communicate with one another
• To illustrate the concept of cooperating processes look at the
   – Example: Producers-consumers problem
• A producer process produces information that is consumed by
  a consumer process
   – Example :
       • A print program produces character that are consumed
         by the printer driver9CM402.14                        8
Cooperating Processes
• To concurrently run producers and consumers processes we
  must have a buffer of items that can be filled by the producer
  and emptied by the consumer
• A producer can produces one item while the consumer is
  consuming another item
• The producer and consumer must be synchronized, so that
   – the consumer does not try to consume an item that has not yet been
     produced

• The consumer must wait until an item is produced
                                9CM402.14                                 9
Example
• Solutions to producer-consumer problem may implement the
  buffer interface shown follows
   Interface for buffer implementation
  Public interface Buffer
  {
   // producers call this method
  public abstract void insert (object item);
   // consumers call this method
   public abstract object remove( );
  }
                               9CM402.14                     10
Example
• The producer process involves the insert( ) method when It
  wishes to enter an item in the buffer
 insert( ) method
Public void insert (object item){
 While (count= = BUFFER SIZE)
     ; // do nothing - - no free buffers
       + + count;
       buffer [in]=item;
       in=(in+1) % BUFFER -SIZE;
 }
                                9CM402.14                      11
Example
•   The consumer calls the remove( ) method when it wants to consume an item
    from the buffer
    remove method
    Public object remove ( ) {
    Object item;
    While (count= = 0)
        ; // do nothing - - nothing to consume
        // remove an item from the buffer
        --count;
        item=buffer [out];
        out=(out+1) % BUFFER _ SIZE;

         return item; }              9CM402.14                           12
Summary

In this class, you have learnt
• Relationship between the processes

• Reasons for Process cooperation
• Cooperating Processes




                             9CM402.14   13
Frequently Asked Questions

1.   Explain about cooperating process

2.   What are the several reasons for cooperating processes

3.   Explain about the relationship between processes




                           9CM402.14                          14
Quiz

1.   A process is ____________ if it cannot affect or be
     affected by the other processes executing in the system
a)   Independent
b)   Dependent
c)   Cooperating




                           9CM402.14                           15
Quiz


2.   A process is ________ if it can affect or be affected by
     other processes executing in the system.
a)   Cooperating
b)   Independent
c)   Dependent




                            9CM402.14                           16
Quiz


3. A process that does not share any data with any
  other process is
a)Independent Process
b) Cooperating
c) Dependent




                    9CM402.14                   17
Other subject materials
•   Web designing
•   Micro processors
•   C++ tutorials
•   java

home

Contenu connexe

Tendances

Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating SystemsRitu Ranjan Shrivastwa
 
Query Decomposition and data localization
Query Decomposition and data localization Query Decomposition and data localization
Query Decomposition and data localization Hafiz faiz
 
Difference between Homogeneous and Heterogeneous
Difference between Homogeneous  and    HeterogeneousDifference between Homogeneous  and    Heterogeneous
Difference between Homogeneous and HeterogeneousFaraz Qaisrani
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)Prakhar Maurya
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memoryAshish Kumar
 
Critical section problem in operating system.
Critical section problem in operating system.Critical section problem in operating system.
Critical section problem in operating system.MOHIT DADU
 
Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System ImplementationWayne Jones Jnr
 
Network Layer design Issues.pptx
Network Layer design Issues.pptxNetwork Layer design Issues.pptx
Network Layer design Issues.pptxAcad
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)Ravinder Kamboj
 
Distributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationDistributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationMNM Jain Engineering College
 
Dma transfer
Dma transferDma transfer
Dma transfergmnithya
 
Communication in Distributed Systems
Communication in Distributed SystemsCommunication in Distributed Systems
Communication in Distributed SystemsDilum Bandara
 

Tendances (20)

Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
 
Query Decomposition and data localization
Query Decomposition and data localization Query Decomposition and data localization
Query Decomposition and data localization
 
Distributed System ppt
Distributed System pptDistributed System ppt
Distributed System ppt
 
Difference between Homogeneous and Heterogeneous
Difference between Homogeneous  and    HeterogeneousDifference between Homogeneous  and    Heterogeneous
Difference between Homogeneous and Heterogeneous
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 
Message passing in Distributed Computing Systems
Message passing in Distributed Computing SystemsMessage passing in Distributed Computing Systems
Message passing in Distributed Computing Systems
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
 
Underlying principles of parallel and distributed computing
Underlying principles of parallel and distributed computingUnderlying principles of parallel and distributed computing
Underlying principles of parallel and distributed computing
 
Critical section problem in operating system.
Critical section problem in operating system.Critical section problem in operating system.
Critical section problem in operating system.
 
Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System Implementation
 
Network Layer design Issues.pptx
Network Layer design Issues.pptxNetwork Layer design Issues.pptx
Network Layer design Issues.pptx
 
Two pass Assembler
Two pass AssemblerTwo pass Assembler
Two pass Assembler
 
Sliding window protocol
Sliding window protocolSliding window protocol
Sliding window protocol
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)
 
File system structure
File system structureFile system structure
File system structure
 
Distributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationDistributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communication
 
Dma transfer
Dma transferDma transfer
Dma transfer
 
Communication in Distributed Systems
Communication in Distributed SystemsCommunication in Distributed Systems
Communication in Distributed Systems
 
Memory management
Memory managementMemory management
Memory management
 
System calls
System callsSystem calls
System calls
 

Similaire à 14 relationship between processes

Producer Consumer Problem in C explained.ppt
Producer Consumer Problem in C explained.pptProducer Consumer Problem in C explained.ppt
Producer Consumer Problem in C explained.pptossama8
 
Lecture 5- Process Synchonization_revised.pdf
Lecture 5- Process Synchonization_revised.pdfLecture 5- Process Synchonization_revised.pdf
Lecture 5- Process Synchonization_revised.pdfAmanuelmergia
 
Presentation: Why Usability Testing Should be Part of your Accessibility Test...
Presentation: Why Usability Testing Should be Part of your Accessibility Test...Presentation: Why Usability Testing Should be Part of your Accessibility Test...
Presentation: Why Usability Testing Should be Part of your Accessibility Test...User Experience Center, Bentley University
 
Foundational Design Patterns for Multi-Purpose Applications
Foundational Design Patterns for Multi-Purpose ApplicationsFoundational Design Patterns for Multi-Purpose Applications
Foundational Design Patterns for Multi-Purpose ApplicationsChing-Hwa Yu
 
6 multiprogramming & time sharing
6 multiprogramming & time sharing6 multiprogramming & time sharing
6 multiprogramming & time sharingmyrajendra
 
UNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptxUNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptxanguraju1
 
【Unite 2017 Tokyo】C#ジョブシステムによるモバイルゲームのパフォーマンス向上テクニック
【Unite 2017 Tokyo】C#ジョブシステムによるモバイルゲームのパフォーマンス向上テクニック【Unite 2017 Tokyo】C#ジョブシステムによるモバイルゲームのパフォーマンス向上テクニック
【Unite 2017 Tokyo】C#ジョブシステムによるモバイルゲームのパフォーマンス向上テクニックUnity Technologies Japan K.K.
 
Lecture_3-Process Management.pdf
Lecture_3-Process Management.pdfLecture_3-Process Management.pdf
Lecture_3-Process Management.pdfHarika Pudugosula
 
Software Engineering Lec 8-design-
Software Engineering Lec 8-design-Software Engineering Lec 8-design-
Software Engineering Lec 8-design-Taymoor Nazmy
 
Software engineering project(srs)!!
Software engineering project(srs)!!Software engineering project(srs)!!
Software engineering project(srs)!!sourav verma
 
HOW TO PHYSICALLY DESIGN A COMPUTER BASED INFORMATION SYSTEM
HOW TO PHYSICALLY DESIGN A COMPUTER BASED INFORMATION SYSTEMHOW TO PHYSICALLY DESIGN A COMPUTER BASED INFORMATION SYSTEM
HOW TO PHYSICALLY DESIGN A COMPUTER BASED INFORMATION SYSTEMRebekahSamuel2
 
6multiprogrammingtimesharing 130112050125-phpapp01
6multiprogrammingtimesharing 130112050125-phpapp016multiprogrammingtimesharing 130112050125-phpapp01
6multiprogrammingtimesharing 130112050125-phpapp01Gaurav Kumar
 
ScalaUA - distage: Staged Dependency Injection
ScalaUA - distage: Staged Dependency InjectionScalaUA - distage: Staged Dependency Injection
ScalaUA - distage: Staged Dependency Injection7mind
 

Similaire à 14 relationship between processes (20)

Ipc feb4
Ipc feb4Ipc feb4
Ipc feb4
 
Producer Consumer Problem in C explained.ppt
Producer Consumer Problem in C explained.pptProducer Consumer Problem in C explained.ppt
Producer Consumer Problem in C explained.ppt
 
Lecture 5- Process Synchonization_revised.pdf
Lecture 5- Process Synchonization_revised.pdfLecture 5- Process Synchonization_revised.pdf
Lecture 5- Process Synchonization_revised.pdf
 
OS_Ch06.pdf
OS_Ch06.pdfOS_Ch06.pdf
OS_Ch06.pdf
 
CHAP4.pptx
CHAP4.pptxCHAP4.pptx
CHAP4.pptx
 
COCOMO
COCOMOCOCOMO
COCOMO
 
Presentation: Why Usability Testing Should be Part of your Accessibility Test...
Presentation: Why Usability Testing Should be Part of your Accessibility Test...Presentation: Why Usability Testing Should be Part of your Accessibility Test...
Presentation: Why Usability Testing Should be Part of your Accessibility Test...
 
Foundational Design Patterns for Multi-Purpose Applications
Foundational Design Patterns for Multi-Purpose ApplicationsFoundational Design Patterns for Multi-Purpose Applications
Foundational Design Patterns for Multi-Purpose Applications
 
6 multiprogramming & time sharing
6 multiprogramming & time sharing6 multiprogramming & time sharing
6 multiprogramming & time sharing
 
UNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptxUNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptx
 
【Unite 2017 Tokyo】C#ジョブシステムによるモバイルゲームのパフォーマンス向上テクニック
【Unite 2017 Tokyo】C#ジョブシステムによるモバイルゲームのパフォーマンス向上テクニック【Unite 2017 Tokyo】C#ジョブシステムによるモバイルゲームのパフォーマンス向上テクニック
【Unite 2017 Tokyo】C#ジョブシステムによるモバイルゲームのパフォーマンス向上テクニック
 
Lecture_3-Process Management.pdf
Lecture_3-Process Management.pdfLecture_3-Process Management.pdf
Lecture_3-Process Management.pdf
 
Software Engineering Lec 8-design-
Software Engineering Lec 8-design-Software Engineering Lec 8-design-
Software Engineering Lec 8-design-
 
Software engineering project(srs)!!
Software engineering project(srs)!!Software engineering project(srs)!!
Software engineering project(srs)!!
 
HOW TO PHYSICALLY DESIGN A COMPUTER BASED INFORMATION SYSTEM
HOW TO PHYSICALLY DESIGN A COMPUTER BASED INFORMATION SYSTEMHOW TO PHYSICALLY DESIGN A COMPUTER BASED INFORMATION SYSTEM
HOW TO PHYSICALLY DESIGN A COMPUTER BASED INFORMATION SYSTEM
 
6multiprogrammingtimesharing 130112050125-phpapp01
6multiprogrammingtimesharing 130112050125-phpapp016multiprogrammingtimesharing 130112050125-phpapp01
6multiprogrammingtimesharing 130112050125-phpapp01
 
ScalaUA - distage: Staged Dependency Injection
ScalaUA - distage: Staged Dependency InjectionScalaUA - distage: Staged Dependency Injection
ScalaUA - distage: Staged Dependency Injection
 
Chapter-1.ppt
Chapter-1.pptChapter-1.ppt
Chapter-1.ppt
 
I07 Simulation
I07 SimulationI07 Simulation
I07 Simulation
 
I07 Simulation
I07 SimulationI07 Simulation
I07 Simulation
 

Plus de myrajendra (20)

Fundamentals
FundamentalsFundamentals
Fundamentals
 
Data type
Data typeData type
Data type
 
Hibernate example1
Hibernate example1Hibernate example1
Hibernate example1
 
Jdbc workflow
Jdbc workflowJdbc workflow
Jdbc workflow
 
2 jdbc drivers
2 jdbc drivers2 jdbc drivers
2 jdbc drivers
 
3 jdbc api
3 jdbc api3 jdbc api
3 jdbc api
 
4 jdbc step1
4 jdbc step14 jdbc step1
4 jdbc step1
 
Dao example
Dao exampleDao example
Dao example
 
Sessionex1
Sessionex1Sessionex1
Sessionex1
 
Internal
InternalInternal
Internal
 
3. elements
3. elements3. elements
3. elements
 
2. attributes
2. attributes2. attributes
2. attributes
 
1 introduction to html
1 introduction to html1 introduction to html
1 introduction to html
 
Headings
HeadingsHeadings
Headings
 
Forms
FormsForms
Forms
 
Css
CssCss
Css
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Starting jdbc
Starting jdbcStarting jdbc
Starting jdbc
 

14 relationship between processes

  • 1. Understand Process Management • Relationship Between Processes 1
  • 2. Recap In the last class, you have learnt • Process Creation • Process Termination HOME PREVIOUS TOPIC NEXT PREVIOUS QUESTION PAPERS FOR OS CPP TUTORIALS 9CM402.14 2
  • 3. Objectives On completion of this class, you will be able to know • Relationship between Processes • Reasons for providing an environment that allows Process cooperation 9CM402.14 3
  • 4. Relationship Between Processes • Concurrent processes executing in the operating system may be either “Independent processes” or “Cooperating processes” • A process is independent if it cannot affect or be affected by the other processes executing in the system • A process that does not share any data with any other process is independent Process • A Process is a cooperating, if it can affect or be affected by the other processes executing in the system • Any process that shares data with other processes is a 9CM402.14 4 cooperating process
  • 5. Relationship Between Processes Reasons for Process cooperation • Information sharing • Computation speedup • Modularity • Convenience 9CM402.14 5
  • 6. Relationship Between Processes Information Sharing • Several users may be interested in same piece of information, Ex. Shared file • Must provide an environment to allow concurrent access to these types of resources Computation Speedup • To run a particular task faster, we must break it into subtasks • Each of the subtask will execute in parallel with others • This is possible only if computer has multiple processing elements ( CPU or I/O channels) 9CM402.14 6
  • 7. Relationship Between Processes Modularity: • For cooperating between systems we have to construct the system in a modular fashion • Dividing the system function into separate processes or threads Convenience: • Even an individual user may work on many tasks at the same time • For instance, a user may be editing, printing and compiling in parallel 9CM402.14 7
  • 8. Cooperating Processors • Concurrent execution that requires cooperation among the processes requires mechanisms to allow processes communicate with one another • To illustrate the concept of cooperating processes look at the – Example: Producers-consumers problem • A producer process produces information that is consumed by a consumer process – Example : • A print program produces character that are consumed by the printer driver9CM402.14 8
  • 9. Cooperating Processes • To concurrently run producers and consumers processes we must have a buffer of items that can be filled by the producer and emptied by the consumer • A producer can produces one item while the consumer is consuming another item • The producer and consumer must be synchronized, so that – the consumer does not try to consume an item that has not yet been produced • The consumer must wait until an item is produced 9CM402.14 9
  • 10. Example • Solutions to producer-consumer problem may implement the buffer interface shown follows Interface for buffer implementation Public interface Buffer { // producers call this method public abstract void insert (object item); // consumers call this method public abstract object remove( ); } 9CM402.14 10
  • 11. Example • The producer process involves the insert( ) method when It wishes to enter an item in the buffer insert( ) method Public void insert (object item){ While (count= = BUFFER SIZE) ; // do nothing - - no free buffers + + count; buffer [in]=item; in=(in+1) % BUFFER -SIZE; } 9CM402.14 11
  • 12. Example • The consumer calls the remove( ) method when it wants to consume an item from the buffer remove method Public object remove ( ) { Object item; While (count= = 0) ; // do nothing - - nothing to consume // remove an item from the buffer --count; item=buffer [out]; out=(out+1) % BUFFER _ SIZE; return item; } 9CM402.14 12
  • 13. Summary In this class, you have learnt • Relationship between the processes • Reasons for Process cooperation • Cooperating Processes 9CM402.14 13
  • 14. Frequently Asked Questions 1. Explain about cooperating process 2. What are the several reasons for cooperating processes 3. Explain about the relationship between processes 9CM402.14 14
  • 15. Quiz 1. A process is ____________ if it cannot affect or be affected by the other processes executing in the system a) Independent b) Dependent c) Cooperating 9CM402.14 15
  • 16. Quiz 2. A process is ________ if it can affect or be affected by other processes executing in the system. a) Cooperating b) Independent c) Dependent 9CM402.14 16
  • 17. Quiz 3. A process that does not share any data with any other process is a)Independent Process b) Cooperating c) Dependent 9CM402.14 17
  • 18. Other subject materials • Web designing • Micro processors • C++ tutorials • java home