节点文献
基于Socket的进程间通信平台的设计与实现
The Design and Implementation of IPC Platform Based on Socket
【作者】 陈剑;
【作者基本信息】 东北大学 , 软件工程, 2009, 硕士
【摘要】 由于中间件技术的广泛应用,现在出现了很多成熟的中间件产品,但是他们大都是以侵入性为主,所应用的范围有所限制。如今分布式计算系统的应用非常广泛,它实际上是由一组分布在网络中不同节点上的进程彼此协作来完成任务的,这些进程通过进程间通信(IPC,InterProcessCommunication)来完成同步、互斥以及数据传送等操作。现在,有一些公司的产品需要基于Socket来解决多进程之间的通信,但市场上并没有一种通用的解决方案。为了能够实现此功能,本文详细讲述了基于Socket的IPC(进程间通讯)的原理和实现。并提出一个能够跨平台、跨语言、灵巧、可配置、具有真正意义上的非侵入性的小型中间件产品。在传统意义上,IPC通常有消息传递(管道,FIFO,Posix和System V消息队列,Socket)、同步(互斥锁,条件变量,读写锁,文件和记录锁,Posix和System V信号灯)、共享内存区域(匿名共享内存区,有名Posix共享内存区,有名System V共享内存区)和过程调用。此项目采用消息传递中的Socket技术来实现,这样可以达到跨平台、跨语言、没有侵入性的目标。本文首先阐述了IPC的意义、方法,继而论述进程间通讯中各个模块儿的工作流程,并着重论述给予Socket的进程间通讯的实现。在实现中应用了软件工程中的自顶向下设计原则对各个模块进行设计开发,采用了诸如线程池、消息队列、消息传输通道的方法来提高系统的性能和吞吐量。本文给出了相应的设计思想和一些关键处理的流程设计,并将它与现有的其他一些解决方案进行了对比。尽管本系统还有它的一些局限性,但从中可以看出这是一个看待此问题的全新的视角,与现有的各种机制相比它提供了更为友好的用户接口,为上层应用的的开发者屏蔽了一些他们本不应该关注的处理通信的细节。
【Abstract】 Since the Middleware was used broadly,there are many mature products.But most of them based on the no intrusive technology,which in turn limited the scope of implementation. Nowadays,distributed system has been used in many fields,distributed system is actually executing by agroup of proeesses,which distribute in different nodes in the network and cooperate with each other,these processes accomplish the operations of synehronization, mutex,and data transport,through IPC.In order to communication between each program, Socket is a nice choice.But there isn’t any common solution in the market for this.This passage gives a detail description on the implementation and principle of IPC(Interprocess Communication) which is on behaves of Socket.In addition,it provides a minimal-middleware of platform-independent,language-independent,facility,configurable and no intrusive system.By traditional,IPC includes message transportation(pipeline,FIFO,posix and system V message queue),synchronization(mutex lock,mutex variables,read-write lock,file and record lock),share memory and process invoking.This project based on the Socket technology of message transportation which can achieve the purpose of platform-independent, language-independent and on intrusive system.This paper first introduces the meaning and method of interprocess communication.Next discuss the workflow of each component of IPC platform and give a detail of implementation of this platform.In the implementation process,the method of top-bottom design principle of software project is adopted.Thread Pool,Message Queue and Message Transportation are used to enhance the system’s performance throughout.The paper provides relevant design thinking and some important transactions flow and contrastes the communication middleware with other process communieation mechanisms at present.Though there are already some little defects here,it is a new visual angle to look on the problem.Contrasted With every mechanisms at present,it provides easier develop interfaces and makes some communication details transparent to the developer.
【Key words】 Socket; Middleware; Thread Pool; Message Queue; IPC;
- 【网络出版投稿人】 东北大学 【网络出版年期】2011年 S1期
- 【分类号】TP311.52
- 【被引频次】21
- 【下载频次】1021