DOC PREVIEW
FSU COP 5611 - Lecture 8 Interprocess Communications

This preview shows page 1-2-3-4-26-27-28-53-54-55-56 out of 56 pages.

Save
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Interprocess Communications Continued Andy Wang COP 5611 Advanced Operating Systems Outline Shared memory IPC Shared memory and large address spaces Windows NT IPC Mechanisms Shared Memory A simple and powerful form of IPC Most multiprogramming OS s use some form of shared memory E g sharing executables Not all OS s make shared memory available to applications Shared Memory Diagram a z b x 10 y 20 Process A Process B Problems with Shared Memory Synchronization Protection Pointers Synchronization Shared memory itself does not provide synchronization of communications Except at the single word level Typically some other synchronization mechanism is used E g semaphore in UNIX Events semaphores or hardware locks in Windows NT Protection Who can access a segment And in what ways UNIX allows some read write controls Windows NT has general security monitoring based on the object status of shared memory Pointers in Shared Memory Pointers in a shared memory segment can be troublesome For that matter pointers in any IPC can be troublesome Shared Memory Containing Pointers a z b y 20 x 10 w 5 Process A Process B A Troublesome Pointer a z b y 20 x 10 w 5 Process A Process B So how do you share pointers Several methods are in use Copy time translation Reference time translation Pointer Swizzling All involve somehow translating pointers at some point before they are used Copy Time Pointer Translation When a process sends data containing pointers to another process Locate each pointer within old version of the data Then translate pointers are required Requires both sides to traverse entire structure Not really feasible for shared memory Reference Time Translation Encode pointers in shared memory segment as pointer surrogates Typically as offsets into some other segment in separate contexts So each sharer can have its own copy of what is pointed to Slow pointers in two formats Pointer Swizzling Like reference time but cache results in the memory location Only first reference is expensive But each sharer must have his own copy Must unswizzle pointers to transfer data outside of local context Stale swizzled pointers can cause problems Shared Memory in a Wide Virtual Address Space When virtual memory was created 16 or 32 bit addresses were available Reasonable size for one process But maybe not for all processes on a machine And certainly not for all processes ever on a machine Wide Address Space Architectures Computer architects can now give us 64 bit virtual addresses A 64 bit address space consumed at 100 MB sec lasts 5000 years Orders of magnitude beyond any process s needs 40 bits can address a TB Do we care Should OS designers care about wide address space Well what can we do with them One possible answer Put all processes in the same address space Maybe all processes for all time Implications of Single Shared Address Space IPC is trivial Shared memory RPC Separation of concepts of address space and protection domain Uniform address space Address Space and Protection Domain A process has a protection domain The data that cannot be touched by other processes And an address space The addresses it can generate and access In standard systems these concepts are merged Separating the Concepts These concepts are potentially orthogonal Just because you can issue an address doesn t mean you can access it Though clearly to access an address you must be able to issue it Existing hardware can support this separation Context Independent Addressing Addresses mean the same thing in any execution context So a given address always refers to the same piece of data Key concept of uniform address systems Allows many OS optimizations improvements Uniform Addressing Allows Easy Sharing Any process can issue any address So any data can be shared All that s required is changing protection to permit desired sharing Suggests programming methods that make wider use of sharing To Opal System New OS using uniform addressing Developed at University of Washington Not intended as slight alteration to existing UNIX system Most of the rest of material specific to Opal Protection Mechanisms for UniformAddressing Protection domains are assigned portions of the address space They can allow other protection domains to access them Read only Transferable access permissions System enforced page level locking Program Execution in Uniform Access Memory Executing a program creates a new protection domain The new domain is assigned an unused portion of the address space But it may also get access to used portions E g a segment containing the required executable image Virtual Segments Global address space is divided into segments Each composed of variable number of contiguous virtual pages Domains can only access segments they attach to Attempting to access unattached segment causes a segment fault Persistent Memory in Opal Persistent segments exist even when attached to no current domain Recoverable segments are permanently stored And can thus survive crashes All Opal segments can be persistent and recoverable Pointers can thus live forever on disk Code Modules in Opal Executable code stored in modules Pure modules can be easily shared Independent of protection domains Because they are essentially static Can get benefit of dynamic loading without run time linking Address Space Reclamation Trivial in non uniform address systems Tricky in uniform address systems Problem akin to reclaiming i nodes in the presence of hard links But even if segments improperly reclaimed only trusting domains can be hurt Windows NT IPC Inter thread communications Local procedure calls Within a single process Between processes on same machine Shared memory Windows NT and Threads Windows NT support multiple threads of control in a single process address space Threads share address space So communication among them is through memory Windows NT and Client Server Computing Windows NT strongly supports the client server model of computing Various OS services are built as servers rather than part of the kernel Windows NT needs facilities to support client server operations Which guide users to building client server solution Client Server Computing and RPC In client server computing clients request services from servers Service can be requested in many ways But RPC is a typical way Windows NT uses a specialized service for single machine RPC Local Procedure Call LPC Similar in many ways to RPC But optimized to only work on a single machine Primarily used to


View Full Document

FSU COP 5611 - Lecture 8 Interprocess Communications

Documents in this Course
Load more
Download Lecture 8 Interprocess Communications
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 8 Interprocess Communications and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 8 Interprocess Communications and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?