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

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 Inlast class, you have learnt : • Multilevel Queue Scheduling • Types of Queues • Multilevel Feed Back Queue Scheduling 3
  • 4.
    Objectives On completionof this class, you would be able to know • Understand Semaphores • Inter Process Communication 4
  • 5.
    Semaphores • Semaphore isbasically 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 usedto 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 • Interprocess 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
  • 9.
  • 10.
    Interprocess Communication • Thislink 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.
  • 14.
    1. Semaphore isbasically a ---------- tool a) Critical section b) A synchronous c) Synchronizing d) None 14
  • 15.
    2. --------- isused 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 providedby message passing systems a) Critical section b) Semaphore c) IPC d) None 16
  • 17.
    4. Semaphore isan 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