1. Computing

Discuss in my forum


6. Inter-Process Communication


The example program that we have seen above is what is known as a realtime process. Not every part of a application program need be written in realtime. It is found that only that part of a program which requires precise time restrictions should be written as a realtime process. Others can be written and executed in user space. User spaces processes are often easier to write, execute and debug than realtime threads. But then, there should be a way to communicate between user space Linux processes and realtime thread. There are several ways for inter-process communication. We will discuss the most important and common way of communication - the realtime FIFO.

6.1 Realtime FIFO

Realtime FIFOs are unidirectional queues (First In First Out). So at one end a process writes data into the FIFO, and from the other end of the FIFO, information is read by another process. Usually, one of these processes is the realtime thread and the other is a user space process.

The Realtime FIFOs are actually character devices (/dev/rtf*) with a major number of 150. Realtime threads uses integers to refer to each FIFO (for example - 2 for /dev/rtf2). There is a limit to the number of FIFOs. There are functions such as rtf_create(), rtf_destroy(), rtf_get(), rtf_put() etc for handling the FIFOs. On the other hand, the Linux user process sees the realtime FIFOs as normal character devices. Therefore the functions such as open(), close(), read() and write() can be used on these devices.
RTLinux HOWTO Table of Content
1. Introduction
  - 1.1 Purpose
  - 1.2 Who should read this HOWTO
  - 1.3 Acknowledgement
  - 1.4 Feedback
  - 1.5 Distribution Policy
2. Installing RTLINUX
3. Why RTLinux
4. Writing RTLinux Programs
  - 4.1 Introduction to writing modules
  - 4.2 Creating RTLinux Threads
  - 4.3 An example program
5. Compiling and Executing
6. Inter-Process Communication
  - 6.1 Realtime FIFO
  - 6.2 Application Using FIFO
7. What next

  1. About.com
  2. Computing
  3. Linux

©2014 About.com. All rights reserved.