SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddel
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddelCHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddel
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddelmohamed khalaf alla mohamedain
 
Deadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbianDeadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbiansaad symbian
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMSkoolkampus
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process ConceptsMukesh Chinta
 
Process Synchronization And Deadlocks
Process Synchronization And DeadlocksProcess Synchronization And Deadlocks
Process Synchronization And Deadlockstech2click
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysisMahesh Bhalerao
 
Difference Program vs Process vs Thread
Difference Program vs Process vs ThreadDifference Program vs Process vs Thread
Difference Program vs Process vs Threadjeetendra mandal
 
Target language in compiler design
Target language in compiler designTarget language in compiler design
Target language in compiler designMuhammad Haroon
 
13. Query Processing in DBMS
13. Query Processing in DBMS13. Query Processing in DBMS
13. Query Processing in DBMSkoolkampus
 
Distributed system architecture
Distributed system architectureDistributed system architecture
Distributed system architectureYisal Khan
 
deadlock handling
deadlock handlingdeadlock handling
deadlock handlingSuraj Kumar
 
Transactions and Concurrency Control
Transactions and Concurrency ControlTransactions and Concurrency Control
Transactions and Concurrency ControlDilum Bandara
 

Mais procurados (20)

Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
Cohesion and coupling
Cohesion and couplingCohesion and coupling
Cohesion and coupling
 
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddel
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddelCHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddel
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddel
 
Process synchronization
Process synchronizationProcess synchronization
Process synchronization
 
Deadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbianDeadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbian
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMS
 
Common Standards in Cloud Computing
Common Standards in Cloud ComputingCommon Standards in Cloud Computing
Common Standards in Cloud Computing
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process Concepts
 
Database System Architectures
Database System ArchitecturesDatabase System Architectures
Database System Architectures
 
Process Synchronization And Deadlocks
Process Synchronization And DeadlocksProcess Synchronization And Deadlocks
Process Synchronization And Deadlocks
 
System calls
System callsSystem calls
System calls
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 
Difference Program vs Process vs Thread
Difference Program vs Process vs ThreadDifference Program vs Process vs Thread
Difference Program vs Process vs Thread
 
Target language in compiler design
Target language in compiler designTarget language in compiler design
Target language in compiler design
 
13. Query Processing in DBMS
13. Query Processing in DBMS13. Query Processing in DBMS
13. Query Processing in DBMS
 
Distributed system architecture
Distributed system architectureDistributed system architecture
Distributed system architecture
 
deadlock handling
deadlock handlingdeadlock handling
deadlock handling
 
Transactions and Concurrency Control
Transactions and Concurrency ControlTransactions and Concurrency Control
Transactions and Concurrency Control
 
Deadlock ppt
Deadlock ppt Deadlock ppt
Deadlock ppt
 
Process of operating system
Process of operating systemProcess of operating system
Process of operating system
 

Semelhante a 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
 

Semelhante a 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
 

Mais 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