Sukhveer Kuar

Embed Size (px)

Citation preview

  • 8/3/2019 Sukhveer Kuar

    1/13

    The capacity of an operating system that allows one processto communicate with another process is known as interprocess

    communication.One process to another process is running simlatanously

    on one or more computer.

    IPC enables controlling and sharing of data between severalapplication without interferying with one another.

  • 8/3/2019 Sukhveer Kuar

    2/13

    TECHNIC OF IPC1. Shared memory technic

    2. Message passing technic

  • 8/3/2019 Sukhveer Kuar

    3/13

    1. SHARED MEMORY TECNIQUE Interprocess communication using shared memory

    requires communicating process to establish a regionof shared memory.

    Shared memory requires that two or more processesagree to remove this restriction.

  • 8/3/2019 Sukhveer Kuar

    4/13

    Typically, a shared memory region resides in theaddress space of the process creating the sharedmemory segment.

    Other processes that wish to communicate using thisshared memory segment must attach it to theiraddress space.

  • 8/3/2019 Sukhveer Kuar

    5/13

    2. MESSAGE PASSING TECNIQUE: In message passing technic the communication take

    place by means of message exchange betweencooperating process.

  • 8/3/2019 Sukhveer Kuar

    6/13

    A message passing facility provides at least twooperation : Send(message) and Receive(message).

    Message sent by a process can be of either fixed orvariable size.

  • 8/3/2019 Sukhveer Kuar

    7/13

    If only fixed sized message can be sent, the system-level implementation is straightforward.

    This restriction, however, makes the task ofprogramming more difficult.

  • 8/3/2019 Sukhveer Kuar

    8/13

    Here are several methods for logically implementing alink and the send() / receive() operation.

    Direct or indirect communication Synchronous or asynchronous communication

    Automatic or explicit buffering

  • 8/3/2019 Sukhveer Kuar

    9/13

    Direct or indirect communication :

    Under direct communication, each process that wants

    to communicateMust explicity name the recipient or sender of thecommunication.

    In this scheme, the send() and receive() primitives are

    defined as: send(P, message)- send a message to process P.

    receive(Q, message)- receive a message from process Q.

  • 8/3/2019 Sukhveer Kuar

    10/13

    With indirect communication, the message are sentto and received from mailboxes, or ports.

    Each mailbox has a unique identification. send(A, message)- send a message to mailbox A.

    receive(A, message)- receive a message from mailbox A.

  • 8/3/2019 Sukhveer Kuar

    11/13

    Synchronization or asynchronous:

    Communication between processes takes place through

    calls to send() and receive() primitives.

    message passing may be either blocking or nonblocking

    also known as synchronous and asynchronous.

  • 8/3/2019 Sukhveer Kuar

    12/13

    Blocking send : The sending process is blocked untilthe message is received by the receiving process or bythe mailbox.

    Nonblocking send : The sending process sends themessage and resumes operation.

    Blocking receive : The receive blocks until a message is

    available. Nonblocking receive : The receive retrieves either a

    valid message or a null.

  • 8/3/2019 Sukhveer Kuar

    13/13

    Automatic or explicit buffering:

    Whether communication is direct or indirect,

    messages exchanged by communicating processesreside in a temporary queue.

    Basically, such queues can be implemented in threeways:

    Zero capacity buffer Bounded capacity buffer

    Unbounded capacity buffer