On 2015-12-30 13:20-0800 Alan W. Irwin wrote: > That is, my mental model of the ideal IPC is the -dev wxwidgets code > launches a wxPLViewer application (WA) and the two processes set up > IPC between them. Then the IPC between the two processes is the one > with control goes about its business until it needs the other to > service a request. Then it simply writes needed data for that request > to a shared memory area and sends a specific signal to the other > process to deal with that data, and then that other process receives > that specific signal and deals with that data and continues until it > needs the other process to service a request. Thus, with this ideal > IPC model, the cpu is busy 100 per cent of the time either running > real code (not a wait loop) in either the device or WA. That is, when > either device or WA are waiting while the other is busy, they are > waiting for explicit signals from the other to proceed and are not in > some sort of inefficient sleep x amount of time and wakeup and check > for activity from IPC partner loop.
Just found a useful illustrative example via google. Take a look at the "Unamed semaphore example" in <http://man7.org/conf/lca2013/IPC_Overview-LCA-2013-printable.pdf> which uses POSIX semaphores to signal between two processes that are accessing the same POSIX shared memory. Naively, this looks quite efficient to me with no unnecessary simultaneous waits by the two processes since sem_wait just blocks until the other process is finished serving the request. I don't understand drivers/wxwidgets_comms.cpp at all, but I do notice you use sem_open, etc., there. Thus, it appears you are using a similar POSIX semaphore basis of method of control between the two processes that are accessing POSIX shared memory. If so, then I frankly cannot see how both processes would spend so much time simultanously waiting with completely idle cpu unless there is some issue with how you have implemented the use of semaphores. So maybe this would be a good time to carefully review that. 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 __________________________ ------------------------------------------------------------------------------ _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel