Browse Prior Art Database

BSD Socket Based Message Queue IPC System Implementation

IP.com Disclosure Number: IPCOM000107316D
Original Publication Date: 1992-Feb-01
Included in the Prior Art Database: 2005-Mar-21
Document File: 6 page(s) / 239K

Publishing Venue

IBM

Related People

Mock, WE: AUTHOR

Abstract

This article describes a method to allow structured message passing between processes using BSD Sockets that emulates the functionality of System V Message Queue IPC. Problem Overview

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 25% of the total text.

BSD Socket Based Message Queue IPC System Implementation

       This article describes a method to allow structured
message passing between processes using BSD Sockets that emulates the
functionality of System V Message Queue IPC.
Problem Overview

      The DCE RPC Runtime environment is multi-threaded. Any system
call that blocks the entire process from executing is not allowed
because all the threads within the process become blocked from
execution.  Even sleep() is not allowed for this reason.

      The Runtime environment provides "wrappers" for common blocking
system calls, for example, read(), write() and all BSD Socket calls.
The "wrappers" convert blocking system calls into non<#1e>blocking
system calls using select(). select() only works on items that
produce a file descriptor.

      System V Message Queue IPC system calls are blocking and
therefore not allowed.  Furthermore, the ability to use select() to
achieve non-blocking functionality is impossible because System V
Message Queue IPC does not generate file descriptors. There is no
known way to convert System V Message Queues to non-blocking.

      The BSD Socket-based Message Queue IPC system provides
functionality similar to System V Message Queue IPC and compatibility
with the DCE RPC Runtime environment.  Since wrappers are provided
for all the Socket system calls, they can operate correctly with a
multi-threaded environment.
Design Description

      BSD Sockets were chosen as the underlying means of IPC because
of the existence of the necessary wrappers that convert the blocking
system calls to non-blocking.  Sockets allow processes to communicate
via a two-way stream of unstructured data.  The concept of sending
and receiving messages is not fundamental to sockets.  The Message
Queue IPC system described in this article structures the stream of
data provided by a socket into a queue of messages waiting to be
received, the "message send" action.  It also queues requests for
messages, the "message receive" action. A message is delivered when a
send/receive action pair is processed; a message cannot be received
unless it has been sent, and vice versa.
Design Requirements

      Messages are user-defined.  The queuing system must not depend
on a particular message structure, except the type field, which
differentiates messages between one another.
      Messages are enqueued in no particular order.
      Messages are dequeued either in absolute first-in, first-out
(FIFO), ignoring type, or type-relative FIFO.
      Absolute FIFO orders the messages only according to their time
of arrival.  The type field is ignored.
      Type-relative FIFO orders the messages first by their type then
by their time of arrival.
Processes that request a message that has not been enqueued are
blocked until one of the specified type is enqueued.

      Mostly unbounded queue size, system resource-dependent.
Implementation Descripti...