Hi Phil:

You have probably noticed my recent push of commit 3da0c90.  That
commit contains my recent (fairly small amount of) wxwidgets IPC code
progress.  The unnamed semaphores method requires the shared memory
buffer be a struct (so that the buffer contains room for the required
semaphores as well as the data array).  So all I have done so far is
to adjust the IPC code so it can use a struct for the shared memory,
but at least this commit tests without issues.

N.B. the new IPC code is only exercised if the experimental cmake
option (which defaults to OFF) is set to ON using
-DPL_HAVE_UNNAMED_POSIX_SEMAPHORES=ON.  And conditional compilation
will be used a lot for this development project.  So for the Windows
case the code that is compiled should be completely unaffected by any
of my changes, and for the non-Windows case by default the OLD IPC
method will be preserved and used unless and until the new IPC method
for that case is at least as efficient and reliable as the old one.

So in the ideal case (where all steps below ultimately work and there
are no efficiency reductions due to any of these steps) the remainng
planned steps in this development effort for the
-DPL_HAVE_UNNAMED_POSIX_SEMAPHORES=ON case are as follows:

1. Make the current one-semaphore approach work with unnamed
semaphores. The last commit put essentially all the infrastructure in
place to support this further change so this change should be a simple
matter of replacing (for this case) the calls to sem_open and
sem_close with sem_init and sem_destroy, and the rest of the current
one-semaphore code should work as is along with the mutex and sleep
API calls required by this method.

2. Move from the present one-semaphore approach (which necessarily
includes mutex and sleep activity) to the mutex- and sleep-free
two-semaphore model following the cmake/test_linux_ipc proof-of-concept
project.

3. Implement a two-semaphore version of (2) that uses named semaphores
instead of unnamed semaphores (because not all POSIX systems support
unnamed semaphores).  So this version should differ from 2 only by a
few lines of code (which are already conditionally in place) to use
sem_open and sem_close rather than sem_init and sem_destroy. N.B. like
(2) this approach should also not require any use of mutex or sleep
API.

4. Implement a build system change to test for unnamed semaphore
functionality and use approach (2) if that functionality is available
but otherwise use approach (3).  This should allow us to drop the
present one-semaphore approach that is used in the non-Windows case.

In sum, my work is cut out for me, but at least I have made some initial
progress toward the above goals, and I am beginning to get a bit more
comfortable with C++.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to