The point of this project is to familiarize PLplot developers with an
efficient Linux IPC example as an aid toward reaching the goal of
figuring out how to make the IPC between the wxwidgets device and the
wxPLViewer viewing application much more efficient on Linux.
(Currently there is plenty of room to reach that goal because that
combination of software is losing up to two orders of magnitude in
practical speed because of excessive idle times for the current way it
uses Linux shared memory IPC.)

In this project we have implemented the "Unnamed Semaphores Example" described
on page 73 and following of <http://man7.org/conf/lca2013/IPC_Overview-LCA-2013-printable.pdf>.
The idea behind this example is to use unnamed POSIX semaphores to control access to
memory that is shared between two applications (called psh_write and psh_read).

To build these examples (as well as pshm_unlink a utility to unlink shared memory that
could be left over after an unclean exit from psh_write) do the usual cmake thing
which is to create an empty directory, change to that directory, and invoke
cmake and make, i.e.,

mkdir build_dir
cd build_dir
cmake ..
make

The pshm_write application reads from stdin and makes those results
available via a buffer in shared memory while the pshm_read
application reads from that shared memory buffer and dumps the results
to stdout.  Use of that shared memory buffer is coordinated using
unnamed semaphores.  So the two applicaitons are run in tandem as
follows:

./pshm_write < <input_file> &
./pshm_read >| <output_file>

where <input_file> is some arbitrary input file
and <output_file> is some arbitrary output file.

(The ./pshm_write process is put in the background above
with the trailing "&" to allow further access to the command line
to run ./pshm_read in the foreground.)

After the above two commands finish,
you can check that the input file and output file are identical with diff.

Also, I timed ./pshm_read here for a 25MB file, and that only required
0.3 seconds so this is a pretty efficient and relatively simple way to
move large amounts of data between processes.  And that time dropped
by almost an order of magnitude if I substantially increased the size
of the shared memory buffer.






