Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!uunet!mstan!chuck From: chuck@Morgan.COM (Chuck Ocheret) Newsgroups: comp.windows.x Subject: Re: Impact of Running Several Large X Programs Message-ID: <3214@s5.Morgan.COM> Date: 6 May 91 17:01:42 GMT References: <1991Apr30.024458.1020@jpl-devvax.jpl.nasa.gov> <9104301628.AA26402@dwight.tcs.com> Organization: Morgan Stanley, & Co., Inc. / New York City, NY Lines: 33 > I ran into this question a while back, and what I did was write my > application so that it was confined to a single structure that included > a display connection[*] and an applicationShell, and no global > variables (except the XtAppContext). This way, "launching another > copy" became something I did within the same process. I saved *tons* > of memory, and gazillions of context switches :-) This approach is valuable in a number of situations. It vastly reduces startup time of all but the first window. Another advantage is that if interfaces are written with this potential use in mind, the UI code is generally more modular. There are fewer global variables since all of the information for each connection must be maintained in state structures. You can easily drop completely different applications into the same program to save on resources. > I was using Motif1.1, and even with shared libraries (on a Sun), > the memory constraint was most alarming ... > > /jordan Actually the biggest constraint when using Motif1.1 is that if you close one of your display connections, you will not be able to open up any more. This is due to a Motif gc caching bug which I experienced and /jordan found and reported. I don't expect this to be fixed anytime soon based on the last report from OSF. This makes this entire technique completely unusable in most environments. ~chuck -- +--------------------+ Chuck Ocheret +---------------+ |chuck@fid.Morgan.COM| Morgan Stanley & Co., Inc. |(212) 703-4474 | | Duty now ... |19th Floor, 1251 Avenue of the Americas|for the future.| +--------------------+ New York, N.Y. 10020 USA +---------------+