[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

2636.0. "Communication betweeen two processes" by CADSE::NORMAN () Fri Apr 20 1990 17:49

I am writing a DECwindows interface for an old CAD application
called VLS. I created a main window, two smaller ones, and a lot of 
other miscellaneous widgets (scroll bars, popup dialog boxes,
popup menus, etc.). The problem comes from the structure of
VLS. It uses a main process and one subprocess. All of the
applications that run under VLS are run from the subprocess.
All of my widgets were created in the main process, but need
to accessable from the subprocess. I tried copying all of the widget
IDs to a global piece of memory which VLS makes available. I then
restore these values when I get to the subprocess. 

It seems that DECwindows uses actual addresses in virtual memory
for the widget IDs. When I try to access any of the widgets in
the subprocess, I get an access vio. probably because the ID
doesn't point to anything in the subprocess memory space.

Does anybody have a good way of dealing with this problem? Remember,
there are a large number of widgets here and I need performance.

			Paul Norman
T.RTitleUserPersonal
Name
DateLines
2636.1can't share client side id'sTOOLEY::B_WACKERFri Apr 20 1990 19:228
Since widgets are client data structures they can't be shared between 
processes unless you could convince the toolkit to put them in shared 
memory and then the addresses would be garbage.

I think you'll need to set up a messaging system between the processes 
and let the widget owner do all the widget manipulations in response 
to messages from the subprocess.  Mailboxes and shared memory are good 
communication media.
2636.2Might even be better...TCC::BLUEJAYOn the back side of the power curveSat Apr 21 1990 10:328
    Who knows..
    
    It might even run faster on multiprocessors that way (one process
    manipulating the widgets, another calculating how the widgets should be
    manipulated), if done with skill&daring (as oppposed to
    ineptitude&cowardice).
    
    						- Bluejay Adametz
2636.3Use client/server modelOSLACT::OLAVDo it in parallel!Mon Apr 23 1990 11:596
Now when you have the chance you should use the client/server model in the
application. Write a client doing all the user interface (DECwindows) which
communicates with the server piece of the application. Then you have the full
flexibility over where you want to run the different parts of the application.

Olav
2636.4pushing the state-of-the-artRIKKA::PALOAllt � einu �g vissi �g g�ti gert �a�!Mon Apr 23 1990 13:538
Perhaps you should wait until CMA (the Concert Multithreaded Architecture)
comes when you could do your redesign to eliminate the subprocess and to 
[naturally] use threads at the same time as inserting DECwindows support.
Threads share a single address space!  In addition, CMA is a portable solution
(Digital's offering will be on all of its critical platforms -- VMS, Un*x, etc)...

	rikki
2636.5If you want more discussion, we can take this off-lineCLTMAX::dickSchoeller - Failed XperimentMon Apr 23 1990 14:0621
Paul,

Somewhere (perhaps in dw_examples?), Steve Klein posted a package which provides
pseudo-widget capability for things for which you only know the window_id.
You could use this to allow the sub-processes to know about the main windows.
I would then create all dialog boxes from the sub-processes (rather than the
main process) as children of the pseudo-widgets.  The only problem you might
run into is with scroll-bars on the main windows.  These would have to be
handled in the main process and pass the data through client messages or some
such to the sub-process.

Knowing what I know about VLS and Compass, I am not going to suggest that you
wait for anything for a means to modify VLS.  Knowing what I know about CMA
and the Toolkit, I would suggest that you look at using CMA for Compass though
you will have to be very careful when you do (Xt and CMA don't mix easily or
well).

In any case, you will not be able to use the main processes widget IDs in the
sub-process for the reason that you already noted.

Dick
2636.6CMA and Multiprocess CommunicationCADSE::CONCORDIAMon Apr 23 1990 14:2723
RE:  .1, .2, .3

   We do already have a mailbox and shared memory mechanism in place for other
   purposes, but we would rather not add the overhead of messages for all 
   the I/O that we do.  The other alternative we have been investigating is
   to pull the system in to one process.  This is promising, but the image/data
   size could reach well over 150Mb (again a performance problem).

RE: .4

   We had looked at CMA to solve another internal problem with the way that our
   system operates, but the indication we had was that the delivery date 
   would be too late for our needs.  Is there a supported version of CMA
   available today?  CMA would also be ideal as we are porting to RISC also.
   Just can't resist the DS5000!!!!

   
   It is our understanding that we will not run into the same promblem under
   Ultrix, is this true?


                                                -Thanks, Dave
2636.7CMA available internally for VMS, don't know about ULTRIX4GL::SCHOELLERWho's on first?Mon Apr 23 1990 20:0917
CMA is definitely available for internal use (we're using it).  Is VLS
going to stay around that long that you want to look at rearchitecting it
that greatly?  If you go with CMA, you will have to make sure that all
X/DECwindows access is MUTEXed (only 1 thread at a time can safely make
X or Xt calls of any kind).

Unless you opertate in a single address space (threads or something like it)
you can't share widgets.  The widget data structures exist in the address
space of the client not the server.  VMS or ULTRIX makes no difference.

If you go with CMA, you will probably run into the large address space
problems that you mentioned.  I am not sure if there is any way around that
with widgets (other than perhaps the pseudo-widget hack fro Steve Klein).

Good luck, you're going to need it.

Dick
2636.8Same problem on Ultrix?CADSE::NORMANTue Apr 24 1990 11:485
We also have to port this mess (VLS) to Ultrix. Are we going to
end up with the same problem there? Are DECwindows widget IDs
known across forks?

			PMN
2636.9PSW::WINALSKICareful with that VAX, EugeneTue Apr 24 1990 21:573
Ultrix should have exactly the same behavior.

--PSW
2636.10how does fork work?CLTMAX::dickSchoeller - Failed XperimentWed Apr 25 1990 12:584
If you can fork processes within the same address space then you may be able
to look at the widgets.  However, you then run into reentrancy problems.

Dick
2636.11FLUME::dikeWed Apr 25 1990 13:587
fork copies the address space, so you get the same data structures.  You also 
get to share file descriptors, notably the X connection, which will lead to
trouble.

vfork doesn't copy the address space, but the parent is put to sleep until the
chile execs or exits.
				Jeff