Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!att!linac!midway!mimsy!mojo!eng.umd.edu!stripes From: stripes@eng.umd.edu (Joshua Osborne) Newsgroups: comp.windows.x Subject: Re: Shared libs with X, Frame (Was: Re: Xkernel) Keywords: shared libs, X, Frame maker Message-ID: <1990Dec26.214324.28624@eng.umd.edu> Date: 26 Dec 90 21:43:24 GMT References: <1990Dec5.214857.13863@agate.berkeley.edu> <1990Dec14.001146.3131@eng.umd.edu> <80@tdatirv.UUCP> <1990Dec19.191336.14848@agate.berkeley.edu> Sender: news@eng.umd.edu (C-News) Reply-To: stripes@eng.umd.edu (Joshua Osborne) Organization: College of Engineering, Maryversity of Uniland, College Park Lines: 77 In article <1990Dec19.191336.14848@agate.berkeley.edu>, stolcke@ICSI.Berkeley.EDU (Andreas Stolcke) writes: > First, let me explain a bit what I meant in my original posting about > 4.1 being slower that 3.5 with X. Dynamic libraries buy you reduced > total virtual memory requirement, [...] > > So far, so good. Now the flip side of shared libs is that they have to be > linked dynamically, i.e. on every invocation of a program /usr/lib/ld.so > is called to resolve references to dynamic libs. The delay this causes on > a 3/50 is non-negligible (it probably is on a Sparc), but probably won't > be too bad for usual interactive work. Also, most commands use only the > shared C lib, so there is not too much dynamic linking to be done. > During the startup phase of X, however, a flury of background jobs all > requiring dynamic linking against the X libs are created, and this is simply > too much for the poor little 3/50s. Again, using my standard X environment, > it takes < 2mins to start up under 3.5, but almost 4mins under 4.1. > So I should have been more precise in talking about `slowness', making it > clear I was talking about startup time. I also had this problem, I was starting up so much stuff that it took 10min to start X on a 3/50. Since I was creating the "default user enviroment" for our users, that was not acceptable. With careful use of vmstat I found peoper places to insert sleeps of the right length. On a 4M 3/50 running SunOS 4.1 starting 2 xterms, an xconsole, a dclock, a xbiff, a xcal, twm, xrdb, and a few other things I'm sure I forgot takes... (drumroll please!) one minute and thirty-two seconds! I can post this amazeing .xinitrc, but it's probbly useless to everyone :-) You can get a aproxmation of my results by inserting a small sleep (11 secons) between starting applications, one you start your xterms (or after every 3rd xterm if you have that many). If you are willing to spend time at it rlogin to the machene you want to tune your login for, and run "vmstat 1". Then play with diffrent delay values in diffrent places. (this is how I got my 3/50, 3/60, and 4/60 values; and how I will get my DECStation 3100 values when I get around to it) [Someone upset because frame doesn't use shared libs] > The reason for Frame's using statically linked binaries is probably that > they want to prevent against someone getting smart and breaking their > license control scheme by `patching' libc.so. I'm not familiar with the > details of their implementation, but suppose it gets the host id to > match it against a built-in licence. It would be easy to fudge the > relevant system calls to always provide the `right' host id... Or to edit the binary, it is easy to find syscalls (hint: run it under a debugger). Or make hostid a per-process value (small, ugly kernel hack). This is a dumb reason to use a static libc, and on our systems would make frame difficult to use (our libc uses DNS, our /etc/host table is very small), and slow (memmory). > I don't see a reason to not use shared X libs, though, and that would be a > *big* win in terms of memory efficiency. Maybe they don't every customer to > have a shared version of X libs, but then they could make it an option. Presumabilly if they used shared libs of any sort it would provide the users another way to break the licence manager. A (more) valid point is that it is a real pain for support. They would need to find out the libc, libX11 version numbers, and god help them if someone (like us) has a non-standard shared lib! This seems to be a tipical vender addatude, 'tho some of the more enlightened ones ship a version that uses shared libs and a staticly linked version. The first thing they ask you to do when you phone in a problem is ask what happens when you run the static version... ...normally they don't provide much help if it works. (normally they don't have to, most people take workarounds without complaint). [NOTE: this info was gained from friends who work places that make products, some of them are on the support side, some are on the bulding side...] -- stripes@eng.umd.edu "Security for Unix is like Josh_Osborne@Real_World,The Multitasking for MS-DOS" "The dyslexic porgramer" - Kevin Lockwood "Don't over-comment" - p151 The Elements of Programming Style 2nd Edition Kernighan and Plauger