Helping ordinary people create extraordinary websites!
HOME TUTORIALS SCRIPTS WEB HOSTING BLOG FORUM
Get Our Newsletter
Email:

Porting Enterprise Apps from UNIX to Linux

By Martyn Honeyford
2005-04-17


Choose an IPC Mechanism

Typically the choice for an interprocess communication (IPC) mechanism -- mechanisms for facilitating communications and data sharing between applications -- is between using signals, writing a loadable kernel extension, or using process-shared mutexes and condition variables.
Signals are the easiest to implement, but in a multi-threaded environment, care has to be taken that all the threads spawned have similar signal masks. The process structure should normally be modeled such that only one thread should handle the signals, or else the signal could be delivered to any of the threads and the results could be unpredictable. It is possible that threads are spawned in a process by other participating entities outside the control of the application and it might not be possible to control their signal masks. Signals might be an unpopular way of doing IPC in a large multi-threaded application for that reason. For example, applications running under an application server could spawn their own threads and could catch signals actually meant for the application server process.

Kernel extensions are not very easy to write and may not be easily portable across various architectures where Linux is supported.

With the advent of the POSIX draft 10 standard and its available implementation on Linux 2.6, process-shared mutexes (mutual exclusion object: a program that allows multiple programs to share the same resources but not simultaneously) and condition variables are a good choice for implementing the IPC mechanism in a multi-process environment. This mechanism would require setting up shared memory in which the mutexes and condition variables reside and all processes will have a common reference for these constructs.

Tutorial Pages:
» A Practical Checklist, Tips, and Insight Drawn from Experience
» Get the Build System Working
» Decide on a Viable Operating Environment
» Architecture-Specific Changes
» Choose an IPC Mechanism
» Select the Threading Model
» File System, Usage Parameters, Stacks
» Memory Maps and Using Shared Memory Segments
» Signaling
» Configure Kernel Karameters
» Parser Tools like lex/yacc
» Globalization Issues
» Security Concerns
» Locating Installed Packages and Variable Data
» Testing
» There's a Port in Every Storm
» Resources


First published by IBM DeveloperWorks


 | Bookmark
Related Tutorials:
» How to Install PHP 5 on Linux
» How to Install Apache 2 on Linux
» How to Install MySQL 5.0 on Linux
» SMB Caching
» Mound --Bind
» Tar Wild Card Interpretation