w

https://en.wikipedia.org/wiki/Remote_procedure_call

In distributed computing a remote procedure call (RPC) is when a computer program causes a procedure (subroutine) to execute in another address space (commonly on another computer on a shared network), which is coded as if it were a normal (local) procedure call, without the programmer explicitly coding the details for the remote interaction. That is, the programmer writes essentially the same code whether the subroutine is local to the executing program, or remote.[1] This is a form of client–server interaction (caller is client, executer is server), typically implemented via a request–response message-passing system. The object-oriented programming analog is remote method invocation (RMI). The RPC model implies a level of location transparency, namely that calling procedures is largely the same whether it is local or remote, but usually they are not identical, so local calls can be distinguished from remote calls. Remote calls are usually orders of magnitude slower and less reliable than local calls, so distinguishing them is important.

RPCs are a form of inter-process communication (IPC), in that different processes have different address spaces: if on the same host machine, they have distinct virtual address spaces, even though the physical address space is the same; while if they are on different hosts, the physical address space is different. Many different (often incompatible) technologies have been used to implement the concept.

History and origins[edit]

Response–request protocols date to early distributed computing in the late 1960s, theoretical proposals of remote procedure calls as the model of network operations date to the 1970s, and practical implementations date to the early 1980s. In the 1990s, with the popularity of object-oriented programming, the alternative model of remote method invocation (RMI) was widely implemented, such as in Common Object Request Broker Architecture (CORBA, 1991) and Java remote method invocation. RMIs in turn fell in popularity with the rise of the internet, particularly in the 2000s.

Remote procedure calls used in modern operating systems trace their roots back to the RC 4000 multiprogramming system,[2] which used a request-response communication protocol for process synchronization.[3] The idea of treating network operations as remote procedure calls goes back at least to the 1970s in early ARPANET documents.[4] In 1978, Per Brinch Hansen proposed Distributed Processes, a language for distributed computing based on "external requests" consisting of procedure calls between processes.[5]

Bruce Jay Nelson is generally credited with coining the term "remote procedure call" (1981),[6] and the first practical implementation was by Andrew Birrel and Bruce Nelson, called Lupine, in the Cedar environment at Xerox PARC.[7][8][9] Lupine automatically generated stubs, providing type-safe bindings, and used an efficient protocol for communication.[8] One of the first business uses of RPC was by Xerox under the name "Courier" in 1981. The first popular implementation of RPC on Unix was Sun's RPC (now called ONC RPC), used as the basis for Network File System.

Message passing[edit]

RPC is a kind of request–response protocol. An RPC is initiated by the client, which sends a request message to a known remote server to execute a specified procedure with supplied parameters. The remote server sends a response to the client, and the application continues its process. While the server is processing the call, the client is blocked (it waits until the server has finished processing before resuming execution), unless the client sends an asynchronous request to the server, such as an XHTTP call. There are many variations and subtleties in various implementations, resulting in a variety of different (incompatible) RPC protocols.

An important difference between remote procedure calls and local calls is that remote calls can fail because of unpredictable network problems. Also, callers generally must deal with such failures without knowing whether the remote procedure was actually invoked. Idempotent procedures (those that have no additional effects if called more than once) are easily handled, but enough difficulties remain that code to call remote procedures is often confined to carefully written low-level subsystems.

Sequence of events[edit]

  1. The client calls the client stub. The call is a local procedure call, with parameters pushed on to the stack in the normal way.
  2. The client stub packs the parameters into a message and makes a system call to send the message. Packing the parameters is called marshalling.
  3. The client's local operating system sends the message from the client machine to the server machine.
  4. The local operating system on the server machine passes the incoming packets to the server stub.
  5. The server stub unpacks the parameters from the message. Unpacking the parameters is called unmarshalling.
  6. Finally, the server stub calls the server procedure. The reply traces the same steps in the reverse direction.

Standard contact mechanisms[edit]

To let different clients access servers, a number of standardized RPC systems have been created. Most of these use an interface description language (IDL) to let various platforms call the RPC. The IDL files can then be used to generate code to interface between the client and servers.

https://zh.wikipedia.org/wiki/远程过程调用

远程过程调用(英语:Remote Procedure Call,缩写为 RPC)是一个计算机通信协议。该协议允许运行于一台计算机的程序调用另一台计算机的子程序,而程序员无需额外地为这个交互作用编程。

信息传递

远程过程调用是一个分布式计算客户端-服务器(Client/Server)的例子,它简单而又广受欢迎。远程过程调用总是由客户端服务器发出一个执行若干过程请求,并用客户端提供的参数。执行结果将返回给客户端。

标准化的沟通机制

为了允许不同的客户端均能访问服务器,许多标准化的 RPC 系统应运而生了。其中大部分采用接口描述语言(Interface Description Language,IDL),方便跨平台的远程过程调用。

要不要把写日志独立成一个Server,需考虑吞吐量,可靠性和负载。在非极高并发的情况下,本地磁盘写比RPC请求可靠性要高(失败率更低),而你丢给LogServer,它最终也还是要保存成文件的。吞吐量则是,本地磁盘的写入速度会不会跟不上数据的产生速度。负载则充分考虑机器的负载能力,例如有些服务器CPU占用很高,但是磁盘IO却很闲,这时写本地文件可充分利用闲置的IO资源。又或者某些服务器本身IO就很繁忙,但网络很闲,就可以考虑把数据通过网络丢给另外的服务去处理更好。

简单来说,就"写日志"本身来说,是一个简单需求,要是能用本地文件解决,就没必要再搞一个Client-Server的模式,通过RPC访问。 
分布式架构需要通盘考虑。
 
 
 
https://technet.microsoft.com/en-us/library/cc738291(v=ws.10).aspx
 
interprocess communication 跨进程通信机制】
 
Microsoft Remote Procedure Call (RPC) is an interprocess communication (IPC) mechanism that enables data exchange and invocation of functionality residing in a different process. That process can be on the same computer, on the local area network (LAN), or across the Internet. The Microsoft RPC mechanism uses other IPC mechanisms, such as named pipes, NetBIOS, or Winsock, to establish communications between the client and the server. With RPC, essential program logic and related procedure code can exist on different computers, which is important for distributed applications.
 
 
 
 
 
 
 

最新文章

  1. SE(homework2)_软件分析
  2. NOIP 考前 KMP练习
  3. log4j写入数据库
  4. boxes
  5. 谈一谈PHP的代码重构
  6. Win10的分辨率问题
  7. myEclipse使用有感
  8. tomcat下jndi的三种配置方式
  9. Directx11学习笔记【二十】 使用DirectX Tool Kit加载mesh
  10. 循序渐进看Java web日志跟踪(2)-Java日志API认识
  11. linux下fdisk分区管理、文件系统管理、挂载文件系统等
  12. javaweb项目环境搭建,jdk,tomcat,myeclipse,sqlserver安装 配置
  13. Linux 环境下 Git 安装与基本配置
  14. Java学习笔记(三)——封装、继承、多态
  15. Linux之安装python
  16. M2阶段团队个人贡献分
  17. IntelliJ IDEA maven springmvc+shiro简单项目
  18. PowerBI开发 第五篇:关系和交互
  19. SpringMVC框架06——文件上传与下载
  20. 剥下“java.lang.OutOfMemoryError: unable to create new native thread”的外衣 创建线程数公式(MaxProcessMemory - JVMMemory – ReservedOsMemory)

热门文章

  1. FreeSWITCH小结:关于export的原理介绍及应用
  2. Powerdesign使用小技巧(转载)
  3. 电脑不识别USB blaster驱动问题
  4. Java创建多线程的三种方法
  5. Installing OwnCloud 9 on Debian 8
  6. 基于C#和Asp.NET MVC开发GPS部标视频监控平台
  7. 无需序列号安装Photoshop CS6
  8. spring-pool.xml
  9. Jquery Deferred 详解
  10. 使用JSP实现用户登录