Mark Stanovich
Download
1 / 12

Mark Stanovich Operating Systems COP 4610 - PowerPoint PPT Presentation


  • 112 Views
  • Uploaded on

Mark Stanovich Operating Systems COP 4610. Primitives to Build Distributed Applications. send and receive Used to synchronize cooperating processes running on different machines Communicate through mailboxes (ports) Temporary holding areas for messages Atomic operations

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Mark Stanovich Operating Systems COP 4610' - netis


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

Mark Stanovich

Operating Systems

COP 4610


Primitives to Build Distributed Applications

  • send and receive

    • Used to synchronize cooperating processes running on different machines

    • Communicate through mailboxes (ports)

      • Temporary holding areas for messages

    • Atomic operations

      • send/receive the entire message or nothing


More on send and receive

  • To put a message to the network

    • send(message, destination_mbox)

    • receive(buffer, mbox)

      • Waits until a message arrives

      • Copies the message into a given buffer


Remote Procedure Call (RPC)

  • Allows you to invoke a procedure on either a local or remote machine

    • Client

      • RemoteMachineSay(“Meow”);

    • Server

      • MachineSay(“Meow”);

  • Implemented on top of two-way messaging


call

reply

reply

call

Client stub

Server stub

OS or Network

RPC Illustrated

Client (caller)

Server (callee)


Procedure Stubs

  • Provide the invocation interface programmers

    • e.g. foo(int a)

  • Client stub

    • Build messages (a.k.a. marshalling)

    • Send messages

    • Wait for response

    • Unpack reply

    • Return result


Server Stub

  • Create N threads to wait for requests

  • Loop

    • Wait for command

    • Decode and unpack request parameters (unmarshalling)

    • Call procedure

    • Build replay message with results

    • Send reply


RPC vs. Procedure Call

  • From the programmer’s viewpoint

    • Similar semantics

  • Pointers are instantiated before transmission

    • Data structures pointed by the pointer are copied

    • Processes running on the remote machine is in a different address space


Implementation Issues

  • Stubs are automatically generated

  • Need to have a well-known port to talk to servers

  • Server can upgrade the implementation without recompiling client applications


Interprocess Communication

  • RPC is just another way to communicate between processes

  • Example uses

    • Microkernel operating systems

      • Portions of an OS are implemented at the user level to minimize the kernel-level code

    • Object linking and embedding (OLE)

      • Mix-and-match applications


Using RPC for IPC

+ Fault isolation: bugs are unlikely to propagate across different address spaces

+ Modularity: independent component upgrades

+ Location transparency: a service can be provided from local or remote machines


Using RPC for IPC

- Poor performance

- Increased number of failure modes

  • Network failure

  • Machine failure

    - More outcomes for procedure execution

  • No execution

  • Partial execution

  • ...


ad