SlideShare a Scribd company logo
1 of 18
Understand Process Management
• Understand Semaphores
• Inter Process Communication




                                           1
HOME     PREVIOUS TOPIC
NEXT
PREVIOUS QUESTION PAPERS
FOR OS
CPP TUTORIALS




                           2
Recap

  In last class, you have learnt :

• Multilevel Queue Scheduling

• Types of Queues

• Multilevel Feed Back Queue Scheduling


                                          3
Objectives


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


• Understand Semaphores


• Inter Process Communication



                                                     4
Semaphores

• Semaphore is basically a synchronizing tool

• Used as a solution to critical section problems

What is critical section?
   – To control access to shared resources, we declare a
     section of code to be critical
   – We regulate access to that section


                                                      5
Semaphores
  Example :

• System consisting of n threads {TO, T1…Tn-1}

• Each thread has a segment of code, called “critical section”

• Where the thread may be changing common variables,
  updating a table & so on
• Important feature of a system is that, when one thread is
  executing in its critical section, no other thread is allowed
  to execute in its critical section                        6
Semaphores

•Semaphore is used to identify whether the operation is to

 be executed or the CPU has to wait

• Semaphore is an integer, it is accessed through two



  operations ie. wait and signal

• Wait is used to test for operation
                                                        7
• Signal is used to increment the integer
Interprocess Communication

• Inter process communication provides a mechanism
   •to allow processes to communicate and to synchronize
   their actions
   •without sharing the same address space
• IPC is provided by message passing systems
• If a Process want to communicate they must send
message and receive messages from each other via a
communication link existing between them
                                                     8
Interprocess Communication
Interprocess Communication

• This link can be implemented in many ways
  –    Direct or Indirect communication
  –    Symmetric or Asymmetric communication
  –    Automatic or Explicit buffering
  –    Send a copy directly or Send by reference
  –    Fixed sized or Variable sized messages

                                                   10
Summary

In this class, you have learnt :

 ---- Critical Section problem

 ---- Semaphores

 ---- Inter Process Communication



                                    11
Frequently Asked Questions

1. What is a Semaphores?

2. Explain Critical Section problem

3. Explain Inter Process Communication




                                         12
QUIZ




       13
1. Semaphore is basically a ---------- tool

    a) Critical section

    b) A synchronous

    c) Synchronizing

    d) None


                                              14
2. --------- is used to identify whether the operation is
   to be executed or the CPU has to wait

  a) Critical – Section

  b) Semaphore

  c) Both

  d) None


                                                       15
3. ---------is provided by message passing systems

  a) Critical section

  b) Semaphore

  c) IPC

  d) None


                                                     16
4. Semaphore is an integer it is accessed through ----

  a) IPC

  b) Critical section

  c) Wait & signal

  d) None

                                                    17
Other subject materials
•   Web designing
•   Micro processors
•   C++ tutorials
•   java

home

More Related Content

What's hot

Chapter 11d coordination agreement
Chapter 11d coordination agreementChapter 11d coordination agreement
Chapter 11d coordination agreementAbDul ThaYyal
 
Logic Formulation 2
Logic Formulation 2Logic Formulation 2
Logic Formulation 2deathful
 
Global state recording in Distributed Systems
Global state recording in Distributed SystemsGlobal state recording in Distributed Systems
Global state recording in Distributed SystemsArsnet
 
Hardware and software parallelism
Hardware and software parallelismHardware and software parallelism
Hardware and software parallelismSumita Das
 
Chapter 1 - An Overview of Computers and Programming Languages
Chapter 1 - An Overview of Computers and Programming LanguagesChapter 1 - An Overview of Computers and Programming Languages
Chapter 1 - An Overview of Computers and Programming LanguagesAdan Hubahib
 
phases of compiler-analysis phase
phases of compiler-analysis phasephases of compiler-analysis phase
phases of compiler-analysis phaseSuyash Srivastava
 
8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating SystemsDr Sandeep Kumar Poonia
 
Principles of Compiler Design
Principles of Compiler DesignPrinciples of Compiler Design
Principles of Compiler DesignMarimuthu M
 
Chapter 11c coordination agreement
Chapter 11c coordination agreementChapter 11c coordination agreement
Chapter 11c coordination agreementAbDul ThaYyal
 
Practical Byzantine Fault Tolernace
Practical Byzantine Fault TolernacePractical Byzantine Fault Tolernace
Practical Byzantine Fault TolernaceYongraeJo
 
MPI message passing interface
MPI message passing interfaceMPI message passing interface
MPI message passing interfaceMohit Raghuvanshi
 

What's hot (20)

Chapter 11d coordination agreement
Chapter 11d coordination agreementChapter 11d coordination agreement
Chapter 11d coordination agreement
 
Logic Formulation 2
Logic Formulation 2Logic Formulation 2
Logic Formulation 2
 
Compiler lecture 03
Compiler lecture 03Compiler lecture 03
Compiler lecture 03
 
Global state recording in Distributed Systems
Global state recording in Distributed SystemsGlobal state recording in Distributed Systems
Global state recording in Distributed Systems
 
Hardware and software parallelism
Hardware and software parallelismHardware and software parallelism
Hardware and software parallelism
 
Chapter 1 - An Overview of Computers and Programming Languages
Chapter 1 - An Overview of Computers and Programming LanguagesChapter 1 - An Overview of Computers and Programming Languages
Chapter 1 - An Overview of Computers and Programming Languages
 
08 subprograms
08 subprograms08 subprograms
08 subprograms
 
phases of compiler-analysis phase
phases of compiler-analysis phasephases of compiler-analysis phase
phases of compiler-analysis phase
 
Macro-processor
Macro-processorMacro-processor
Macro-processor
 
9 subprograms
9 subprograms9 subprograms
9 subprograms
 
8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems
 
MPI History
MPI HistoryMPI History
MPI History
 
Subprogram
SubprogramSubprogram
Subprogram
 
Slide05 Message Passing Architecture
Slide05 Message Passing ArchitectureSlide05 Message Passing Architecture
Slide05 Message Passing Architecture
 
Principles of Compiler Design
Principles of Compiler DesignPrinciples of Compiler Design
Principles of Compiler Design
 
Chapter 11c coordination agreement
Chapter 11c coordination agreementChapter 11c coordination agreement
Chapter 11c coordination agreement
 
Practical Byzantine Fault Tolernace
Practical Byzantine Fault TolernacePractical Byzantine Fault Tolernace
Practical Byzantine Fault Tolernace
 
Phases of-compiler
Phases of-compilerPhases of-compiler
Phases of-compiler
 
Phases of Compiler
Phases of CompilerPhases of Compiler
Phases of Compiler
 
MPI message passing interface
MPI message passing interfaceMPI message passing interface
MPI message passing interface
 

Similar to 22 semaphores nd proces communi

Fault tolerance in distributed systems
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systemssumitjain2013
 
Operating system 27 semaphores
Operating system 27 semaphoresOperating system 27 semaphores
Operating system 27 semaphoresVaibhav Khanna
 
Inter Process Communication - IPC
Inter Process Communication - IPCInter Process Communication - IPC
Inter Process Communication - IPCPravjot Singh
 
System Programming - Interprocess communication
System Programming - Interprocess communicationSystem Programming - Interprocess communication
System Programming - Interprocess communicationHelpWithAssignment.com
 
Presentation - Programming a Heterogeneous Computing Cluster
Presentation - Programming a Heterogeneous Computing ClusterPresentation - Programming a Heterogeneous Computing Cluster
Presentation - Programming a Heterogeneous Computing ClusterAashrith Setty
 
2012 S&P Paper Reading Session1
2012 S&P Paper Reading Session12012 S&P Paper Reading Session1
2012 S&P Paper Reading Session1Chong-Kuan Chen
 
Inter-Process Communication in distributed systems
Inter-Process Communication in distributed systemsInter-Process Communication in distributed systems
Inter-Process Communication in distributed systemsAya Mahmoud
 
Operating-System-(1-3 group) Case study on windows Mac and linux among variou...
Operating-System-(1-3 group) Case study on windows Mac and linux among variou...Operating-System-(1-3 group) Case study on windows Mac and linux among variou...
Operating-System-(1-3 group) Case study on windows Mac and linux among variou...ssuser4a97d3
 
Multithreaded Programming Part- III.pdf
Multithreaded Programming Part- III.pdfMultithreaded Programming Part- III.pdf
Multithreaded Programming Part- III.pdfHarika Pudugosula
 
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...
Message Passing, Remote Procedure Calls and  Distributed Shared Memory as Com...Message Passing, Remote Procedure Calls and  Distributed Shared Memory as Com...
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...Sehrish Asif
 
6 multiprogramming & time sharing
6 multiprogramming & time sharing6 multiprogramming & time sharing
6 multiprogramming & time sharingmyrajendra
 
Multiprocessing -Interprocessing communication and process sunchronization,se...
Multiprocessing -Interprocessing communication and process sunchronization,se...Multiprocessing -Interprocessing communication and process sunchronization,se...
Multiprocessing -Interprocessing communication and process sunchronization,se...Neena R Krishna
 

Similar to 22 semaphores nd proces communi (20)

Fault tolerance in distributed systems
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systems
 
IPC
IPCIPC
IPC
 
IPC
IPCIPC
IPC
 
Operating system 27 semaphores
Operating system 27 semaphoresOperating system 27 semaphores
Operating system 27 semaphores
 
Inter Process Communication - IPC
Inter Process Communication - IPCInter Process Communication - IPC
Inter Process Communication - IPC
 
Lecture 5 inter process communication
Lecture 5 inter process communicationLecture 5 inter process communication
Lecture 5 inter process communication
 
System Programming - Interprocess communication
System Programming - Interprocess communicationSystem Programming - Interprocess communication
System Programming - Interprocess communication
 
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
 
Scheduling Thread
Scheduling  ThreadScheduling  Thread
Scheduling Thread
 
Presentation - Programming a Heterogeneous Computing Cluster
Presentation - Programming a Heterogeneous Computing ClusterPresentation - Programming a Heterogeneous Computing Cluster
Presentation - Programming a Heterogeneous Computing Cluster
 
2012 S&P Paper Reading Session1
2012 S&P Paper Reading Session12012 S&P Paper Reading Session1
2012 S&P Paper Reading Session1
 
Inter-Process Communication in distributed systems
Inter-Process Communication in distributed systemsInter-Process Communication in distributed systems
Inter-Process Communication in distributed systems
 
Operating-System-(1-3 group) Case study on windows Mac and linux among variou...
Operating-System-(1-3 group) Case study on windows Mac and linux among variou...Operating-System-(1-3 group) Case study on windows Mac and linux among variou...
Operating-System-(1-3 group) Case study on windows Mac and linux among variou...
 
CHAP4.pptx
CHAP4.pptxCHAP4.pptx
CHAP4.pptx
 
Os
OsOs
Os
 
Multithreaded Programming Part- III.pdf
Multithreaded Programming Part- III.pdfMultithreaded Programming Part- III.pdf
Multithreaded Programming Part- III.pdf
 
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...
Message Passing, Remote Procedure Calls and  Distributed Shared Memory as Com...Message Passing, Remote Procedure Calls and  Distributed Shared Memory as Com...
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...
 
6 multiprogramming & time sharing
6 multiprogramming & time sharing6 multiprogramming & time sharing
6 multiprogramming & time sharing
 
Multiprocessing -Interprocessing communication and process sunchronization,se...
Multiprocessing -Interprocessing communication and process sunchronization,se...Multiprocessing -Interprocessing communication and process sunchronization,se...
Multiprocessing -Interprocessing communication and process sunchronization,se...
 
8
88
8
 

More from 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
 

22 semaphores nd proces communi

  • 1. Understand Process Management • Understand Semaphores • Inter Process Communication 1
  • 2. HOME PREVIOUS TOPIC NEXT PREVIOUS QUESTION PAPERS FOR OS CPP TUTORIALS 2
  • 3. Recap In last class, you have learnt : • Multilevel Queue Scheduling • Types of Queues • Multilevel Feed Back Queue Scheduling 3
  • 4. Objectives On completion of this class, you would be able to know • Understand Semaphores • Inter Process Communication 4
  • 5. Semaphores • Semaphore is basically a synchronizing tool • Used as a solution to critical section problems What is critical section? – To control access to shared resources, we declare a section of code to be critical – We regulate access to that section 5
  • 6. Semaphores Example : • System consisting of n threads {TO, T1…Tn-1} • Each thread has a segment of code, called “critical section” • Where the thread may be changing common variables, updating a table & so on • Important feature of a system is that, when one thread is executing in its critical section, no other thread is allowed to execute in its critical section 6
  • 7. Semaphores •Semaphore is used to identify whether the operation is to be executed or the CPU has to wait • Semaphore is an integer, it is accessed through two operations ie. wait and signal • Wait is used to test for operation 7 • Signal is used to increment the integer
  • 8. Interprocess Communication • Inter process communication provides a mechanism •to allow processes to communicate and to synchronize their actions •without sharing the same address space • IPC is provided by message passing systems • If a Process want to communicate they must send message and receive messages from each other via a communication link existing between them 8
  • 10. Interprocess Communication • This link can be implemented in many ways – Direct or Indirect communication – Symmetric or Asymmetric communication – Automatic or Explicit buffering – Send a copy directly or Send by reference – Fixed sized or Variable sized messages 10
  • 11. Summary In this class, you have learnt : ---- Critical Section problem ---- Semaphores ---- Inter Process Communication 11
  • 12. Frequently Asked Questions 1. What is a Semaphores? 2. Explain Critical Section problem 3. Explain Inter Process Communication 12
  • 13. QUIZ 13
  • 14. 1. Semaphore is basically a ---------- tool a) Critical section b) A synchronous c) Synchronizing d) None 14
  • 15. 2. --------- is used to identify whether the operation is to be executed or the CPU has to wait a) Critical – Section b) Semaphore c) Both d) None 15
  • 16. 3. ---------is provided by message passing systems a) Critical section b) Semaphore c) IPC d) None 16
  • 17. 4. Semaphore is an integer it is accessed through ---- a) IPC b) Critical section c) Wait & signal d) None 17
  • 18. Other subject materials • Web designing • Micro processors • C++ tutorials • java home