HOME
ABOUT GCS
INTERFACE
DESCRIPTION
EXAMPLES

GCS Note g0004
IPC Version

September 25, 2002
Last Modified February 9, 2003

1. Purpose
This note describes the IPC version.

2. Role of the IPC in GCS
One of the key features of GCS is that a client can access, through his cilent source program, any of a large number of built-in functions.
It is possible to achieve this functionality by utilizing the Inter-Process-Communication (IPC) mechanism.

The idea is to make 500 executable program files in the server hard disk. Each program of them contains on average 20 functions so that the entire system can serve 10,000 functions. We will name those programs with the sequential number like f000, f001 and so on.
A separate program is prepared that identifies and returns the names of the files when asked by the GCS CGI program with a name of a function. We will call this program as the function database and name it fdb.

The main program parses the client source program and identifies the names of the functions the client calls.
There are 3 kinds of functions that clients may call. The first kind is the user defined functions. They are defined by the client within the client source program.
The second is the functions served by the main GCS program.
The third kind of functions are served through IPC by the function programs.

The IPC mechanism is invoked only when functions of the third kind are called by the client program. In this case, the main program invokes the function database and gets the names of the executable files that contain the required functions.

Then the main program terminates the function database and invokes the function programs by loading the identified executable files one by one.

Next, the main program executes the client's source program. It communicates with an appropriate function program when a function to be handled by the function program is called.
After completing the the necessary processing, the main program terminates all of the function programs and cleans up the IPC mechanism before exiting.

All these hassls are totally invisible to the client, who can use in his C program any combination of the functions from the list of 10,000 functions.

3. Interprocess Communication Methods
There are many interprocess-communication tools in the UNIX/Linux environment. I used the shared memory and the System V semaphore out of them.

The shared memory is used to pass the data between the main GCS program and the function database program or the function programs. The semaphores controll the order of execution for the separate processes.

4. Source Code Files
p077.c
draw.c
draw1.c
draw2.c
draw3.c
draw4.c
font.c
gcs1.c
gcs2.c
draw.h
draw1.h
draw2.h
draw3.h
draw4.h
gcs1.h
gcs2.h

fdb.c function database
f001.c function program 1
f002.c GSL (GNU Scientific Library)
f003.cpp function program written in C++
f004.cpp Finite Element Method
f005.c Xlib drawings
f006.c Xlib drawings
f007.c Xlib drawings
f008.c Xlib drawings
f009.c OpenGL drawings
f010.c OpenGL drawings
f011.cpp STL Vector
f012.c Time Recorder
f013.c Bookkeeping
f014.c JPEG
f017.c File Uploads
f018.c Function and Example
f019.cpp Accounting by File Upload
f020.c former f000
f021.c Calendar Memo
f022.c Album
f023.c Time Trend

5. Interface and Examples
Interface
Examples

6. List of Functions
The functions are listed for each fefining programs.
List of Functions

GCS NOTES