Portable Inter Process Communication Programming

Portable Inter Process Communication Programming

The Second International Conference on Advanced Engineering Computing and Applications in Sciences Portable Inter process Communication Programming Morteza Kashyian Computer Engineering Department Iran University of Science & Technology [email protected] Seyedeh Leili Mirtaheri Ehsan Mousavi Khaneghah Department of Computer Engineering Department of Computer Engineering Iran University of Science & Technology Iran University of Science & Technology [email protected] [email protected] Abstract Most applications are consisted of several activities that are fulfilled by different processes. programs. This idea enables developers to And even processes are included different child program on top of the existing IPC mechanisms processes named light processes or threads. The and uses their functionalities. But what is IPC? basic idea of dividing the whole activities to Inter process Communication (IPC) is a processes is followed by the reusability and collection of mechanisms that provide sharing ideas. Therefore, applications need an communication between two processes with their IPC mechanism to establish the communication different memory space. The point to consider is between the processes. Inter process the unawareness of programs from each other. communication that is known as IPC is a The independency causes programs are written collection of mechanisms that meet the in different domain and communicate easily. As communication requirements between processes. a result IPC enable applications to have System V defines standard for IPC mechanism concurrent task. [1] named SVIPC. Different operating systems The only problem is the lake of uniform solution implement SVIPC standard in different manner. because different operating systems implement Therefore programs that are using the IPC these mechanisms on their own way like Apple mechanism have different structure in other Event technology by Apple or Object Linking operating systems. On the other hand and Embedding by Microsoft and Message reproducing program for various operating Passing by Linux. Some of them are common in systems is a time consuming activity. Porting is a all operating system like Pipe, but solution to writing programs with the least implementation mechanisms are different and changes to port them on different operating cause to not be portable between operating systems. In this survey we present a brief systems. introduction of various IPC mechanisms in the Different communication techniques like two operating systems and describe porting message passing or shared memory are used to Windows’ programs to Linux by mapping the implement communication. On the other hand IPC primitives as a solution. We present the different implementation on various operating porting as a solution to portable IPC systems causes those written programs for a programming. While the program is written with family of operating system cannot simply run on windows IPC mechanism can use our wrapper to another family. Therefore, considering be able to run in Linux operating system. portability feature can regulate the problem. The Keywords: Inter process communication, objective of the following solution is to suggest a SVIPC, Linux, Windows, and Portability. solution to implement portable IPC in 1. Introduction heterogeneous environment with different operating systems without programmer effort to One of the most important subjects in the change and modify the program. programming is communication between the 978-0-7695-3369-8/08 $25.00 © 2008 IEEE 181 DOI 10.1109/ADVCOMP.2008.38 Portability requirement is augmented with the the kernel objects is the Win32-API or other growth in high performance computing subsystems such as POSIX. The Win32 allows applications and causes to increase various type developers write applications that run on all of migration. And establish to programmer a safe versions of Windows. On the other hand POSIX programming while programmer doesn’t need to provides a portable and standard-compliant change the program from one environment to environment to run an application on different another environment. It includes different operating systems [7]. In this area our focuses is methods and implementations for specific IPC in the Win32-API and the equivalent domains with individual requirements in, other mechanisms in the Linux. words it requires ad hoc solutions [3]. 3. IPC in MS-WIN Also portability is treated as a quality factor in software engineering [8, 9]. Unfortunately there MS-Win provide a wide range of IPC is not a systematic way to identify the portability mechanisms such as Clipboard, Data Copy, problems. Winsock and others to send and receive the Portability ability of the programming language messages between two processes or copy the is a key point to generate portable programs or to data in a shared section in memory or file. In the implement a solution to port programs. following nine IPC mechanisms supported by Obviously, portability achievement with low level languages is more accessible, i.e. more near MS-Win are mentioned briefly. In Clipboard mechanism coupling between the to machine code more flexibility to port the program. However, with the very low level processes is low and the drawback is that the processes must agree on the data format. It can languages, the simplicity of use is lost. In be used between applications and within an addition chosen language should be application. A memory object can be any data understandable by most machines like format (clipboard format). By Data Copy the FORTRAN, COBOL or C. the languages other than C despite of standards have vast differences data is being copied to the destination memory space from the source memory space after that on different operating systems [6]. Languages communication is established by sending request like C, C++, Shell, Perl, Tcl, Python, Java and message (WM_COPYDATA) to the destination Emacs Lisp are highly portable. Despite the possibility to port the C code between UNIX process and identification of the sender by receiver. Dynamic Data Exchange does not species, C binding differences on other operating define any restriction on the exchanged data systems are the source of portability problems, format as previously mentioned one. although Windows NT supports ANSI/POSIX C In contrary to the Clipboard that is one-time API [12]. response to user command the DDE is a C language is suitable one because has continual data exchange. It can be used between capabilities like typedef that isolate the definition of machine dependent data types, tight coupled application by customize the DDE data format to implement special purpose IPC. In sizeof(type) construct to find the size of any of these defined data types and the union the File Mapping the contents of a file can be mapped to a virtual memory. Mailslot enable declaration to define the overlaying of data [5]. processes to communicate each other in a one- On the other hand C is not fully type-safe way channel. Server is the process that creates language and that causes difficulties to declare portability on machines. the mailslot and mailslot clients by writing messages to their mailslots can communicate All these portable languages have to use with the server. It is suitable one for operating system s system calls or API s for IPC asynchronous communication. Pipes are mechanisms and extremely are depended to supported about in all operating systems. MS- operating system. Operating systems have different architectures. Win supports two types of pipes, named and anonymous. The later one enable the related processes like the child process to exchange the 2. MS-WIN Architecture data with their parents. To provide a duplex operation the processes need to create two In the first glance to the architecture of the MS- anonymous pipes, one from client to server and Win, it is consists of two major parts, kernel and the other one for the reverse direction. In user modes (Fig 1). And the only way to access contrary to the anonymous, the named pipes do 182 not have any restriction in the communication system. So it can be reused after doing all I/O between non-related processors. A named pipe operations. Full duplex pipe is a bidirectional server is identified by the name of the pipe (well stream based connection. System V IPC named pipe) and data will be transferred after introduces three communication mechanisms both the server and the client connect to named (message queues, semaphores, and shared pipe. Winsock is the MS-Win implementation of memory). To use the System V IPC it is sockets popularized by Berkeley Software sufficient to obtain the unique id of the IPC Distribution (BSD). It uses the communication object. Message queue is a linked list in the capabilities of the underlying protocol. Therefore address space of the kernel. On the other hand it provides a protocol-independent interface such semaphore is an integer to lock the shared that an application using Winsock can resources in a multiple process environment. As communicate with other applications using a matter of fact message queue is a linked list different socket implementation on other within the address space of the kernel. Messages systems. It is very helpful to implement the are sent to the queue in order and can be communication between heterogeneous retrieved in different ways. Semaphore acts as a operation systems. Remote Procedure Call counter and is used by processes to control enables applications to call functions of the other access to shared resources. For example to applications remotely. The RPC facility provided prevent writing to a memory segment in shared by Windows is compliant with the Open memory. It implements locking mechanism. For Software Foundation (OSF) Distributed example, to prevent writing to a same memory Computing Environment (DCE). Therefore segment more than more than one in shared applications on different operating systems that memory mechanism. A mapped and shared area support DCE can communicate each other. Since of memory by multiple processes is called shared the RPC handle communication between memory.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    6 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us