Remote Procedure Call Message Passing
12.2 Programming Interfaces
Being able to name your partner is just a pre-requisite. The main issue in communi- cation is being able to exchange information. Processes cannot do so directly — they need to ask the operating system to do it for them. This section describes various interfaces that can be used for this purpose.12.2.1 Remote Procedure Call
A natural extension to procedure calls is to call remote procedures The most structured approach to communication is to extend the well-known pro- cedure calling mechanism, and allow one process to call a procedure from another process, possibly on a different machine. This is called a remote procedure call RPC. This idea has become even more popular with the advent of object-oriented program- ming, and has even been incorporated in programming languages. An example is Java’s remote method invocation RMI. However, the idea can be implemented even if the program is not written in a language with explicit support. The implementation is based on stub procedures The implementation is based on stubs — crippled procedures that represent a remote procedure by having the same interface. The calling process is linked with a stub that has the same interface as the called procedure. However, this stub does not implement this procedure. Instead, it sends the arguments over to the stub linked with the other process, and waits for a reply. return call garg send retval recv retval send arg stub for g procedure f call garg . . . . . . stub for f procedure g receive arg The other stub mimics the caller, and calls the desired procedure locally with the specified arguments. When the procedure returns, the return values are shipped back and handed over to the calling process. RPC is a natural extension of the procedure call interface, and has the advantage of allowing the programmer to concentrate on the logical structure of the program, 200 while disregarding communication issues. However, it is only applicable on sets of computers that run the same system or at least the same runtime environment. Exercise 151 Can any C function be used by RPC?12.2.2 Message Passing
RPC organized communication into structured and predefined pairs: send a set of arguments, and receive a return value. Message passing allows more flexibility by allowing arbitrary interaction patterns. For example, you can send multiple times, without waiting for a reply. Messages are chunks of data On the other hand, message passing retains the partitioning of the data into “chunks” — the messages. Sending and receiving are discrete operations, on one message. This allows for special features, such as dropping a message and proceeding directly to the next one. It is also the basis for collective operations, in which a whole set of processes participate e.g. broadcast, where one process sends information to a whole set of other processes. These features make message passing attractive for communication among the processes of parallel applications. It is not used much in networked settings.12.2.3 Streams: Unix Pipes, FIFOs, and Sockets
Parts
» | Komputasi | Suatu Permulaan
» Operating System Functionality | Komputasi | Suatu Permulaan
» Abstraction and Virtualization | Komputasi | Suatu Permulaan
» Hardware Support for the Operating System
» Roadmap | Komputasi | Suatu Permulaan
» Scope and Limitations | Komputasi | Suatu Permulaan
» Performance Metrics | Komputasi | Suatu Permulaan
» Statistical Characterization of Workloads
» Analysis, Simulation, and Measurement
» Modeling: the RealismComplexity Tradeoff
» Waiting in Queues Queueing Systems
» Queueing Analysis Queueing Systems
» Incremental Accuracy Simulation Methodology
» Workloads: Overload and Lack of Steady State
» Summary | Komputasi | Suatu Permulaan
» Process States What is a Process?
» Operations on Processes and Threads
» Multiprogramming and Responsiveness Having Multiple Processes in the System
» Multiprogramming and Utilization Having Multiple Processes in the System
» Multitasking for Concurrency The Cost
» Performance Metrics Scheduling Processes and Threads
» Handling a Given Set of Jobs
» Using Preemption Scheduling Processes and Threads
» Priority Scheduling Scheduling Processes and Threads
» Starvation, Stability, and Allocations
» Fair Share Scheduling Scheduling Processes and Threads
» Concurrency and the Synchronization Problem
» Mutual Exclusion Algorithms Mutual Exclusion for Shared Data Structures
» Semaphores and Monitors Mutual Exclusion for Shared Data Structures
» Locks and Disabling Interrupts
» Deadlock and Livelock Resource Contention and Deadlock
» A Formal Setting Resource Contention and Deadlock
» Deadlock Prevention, Avoidance, and Detection
» Real Life Resource Contention and Deadlock
» Mapping Memory Addresses | Komputasi | Suatu Permulaan
» Support for Segmentation Segmentation and Contiguous Allocation
» Algorithms for Contiguous Allocation
» Address Translation Paging and Virtual Memory
» Algorithms for Page Replacement
» Swapping | Komputasi | Suatu Permulaan
» Links Alternatives for File Identification
» Data Access Access to File Data
» Caching and Prefetching Access to File Data
» Memory-Mapped Files Access to File Data
» Mapping File Blocks Storing Files on Disk
» Reliability Storing Files on Disk
» Levels of Security System Security
» Mechanisms for Restricting Access
» User Identification | Komputasi | Suatu Permulaan
» Controling Access to System Objects
» Virtualization | Komputasi | Suatu Permulaan
» Resource Management | Komputasi | Suatu Permulaan
» Reduction Hardware Support and Co-Design
» Booting the System | Komputasi | Suatu Permulaan
» Timers Kernel Priorities Context Switching
» Kernel Address Mapping Making a System Call
» Error Handling | Komputasi | Suatu Permulaan
» Parallelism vs. Concurrency Kernel Locking Conflicts SMP Scheduling Multiprocessor Scheduling
» Supporting Multicore Environments System Composition
» Code Structure Monolithic Kernel Structure
» Microkernels | Komputasi | Suatu Permulaan
» Extensible Systems | Komputasi | Suatu Permulaan
» Naming | Komputasi | Suatu Permulaan
» Remote Procedure Call Message Passing
» Streams: Unix Pipes, FIFOs, and Sockets
» Shared Memory Programming Interfaces
» Distributed System Structures | Komputasi | Suatu Permulaan
» Example Client-Server Systems | Komputasi | Suatu Permulaan
» Middleware | Komputasi | Suatu Permulaan
» Protocol Stacks Communication Protocols
» Error Correction Implementation Issues
» TCP Congestion Control Implementation Issues
» Authentication Authentication and Security
» Security Authentication and Security
» Networked File Systems | Komputasi | Suatu Permulaan
» Load Balancing | Komputasi | Suatu Permulaan
» Requirements Scheduling in Real-Time Systems
Show more