bpo_* - Base Plus Offset routines

This document describes the various files in the bpo_* series and details the functions described therein.

The bpo_* routines are designed to provide process independent method of sharing data using IPC shared memory or mmap()-ed files. The routines provide convenient ways to attach to segments, allocate memory, register processes and resources, inter-process locking, message queueing.

Most of the functions described require a hint as to where the required action should take place. This is because there can be many such attached segments, not all of them with the same characteristics. This hint can usually take the form of the pointer returned when the segment was created/attached.

An important point to note is that within the various routines, and in any stored structures, there are no actual memory addresses used. This is because the given segment may be mapped to different addresses for given processes. So, all object references are stored as the offset from the base of the segment.

In a number of cases, the routines will return a genuine pointer, this is for the application's convenience. Any reference to the object returned that is to be stored directly by the application should be done as an offset rather than the pointer, probably by calling the relevant conversion routine.


The Files

The various routines are split into various files according to their function. To use routines defined in a given module include the relevant .h Any required bpo_*.h files will automatically be included. In addition, the following standard include files will usually be required.
    #include <sys/types.h>
    #include <sys/time.h>
    #include <sys/stat.h>
    #include <sys/mman.h>
    #include <sys/ipc.h>
    #include <sys/shm.h>

The various files in the suite are..

mplib1/bpo_lock.h
Inter-process locks.
mplib1/bpo_list.h
Linked List functions
mplib1/bpo_init.h
Segment Create/Attach & Resource functions
mplib1/bpo_alloc.h
Allocate routines
mplib1/bpo_proc.h
Process functions
mplib1/bpo_queue.h
Queue functions