Path: utzoo!mnetor!uunet!dalcs!force10!erskine From: erskine@force10.UUCP (Neil Erskine) Newsgroups: comp.unix.wizards Subject: Re: Sticky bit -- To set or not to set. Message-ID: <651@force10.UUCP> Date: 27 Apr 88 19:07:49 GMT References: <13085@brl-adm.ARPA> <3571@gryphon.CTS.COM> Reply-To: erskine@force10.UUCP (Neil Erskine) Followup-To: comp.unix.wizards Organization: AP Computers. Halifax. Lines: 42 In article <3571@gryphon.CTS.COM> sarima@gryphon.CTS.COM (Stan Friesen) writes: >In article <13085@brl-adm.ARPA> "oread::barbanis"@coins.cs.umass.edu writes: >> >>Is there any reason at all to have the sticky bit on in an executable? >>Or, to put it differently, under what circumstances should it be set? > The sticky bit should be set *only* for very heavily used programs >that are not in continuous use. It is intended to help reduce the startup >overhead of major system utilities, like vi, especially moderately large ones. ..... >Thus on most systems only vi/ex and perhaps the >shells need or should have the sticky bit set. On some turnkey systems it >might be useful to make the main user application sticky as well. On the systems I have used (System V variants, swapping and paging), setting the sticky bit on a shell is of little or no use. The effect of the sticky bit is the same as the effect of someone already executing the program. In the case of the shell, this is practically always so. If you have a system with a large number of users, most of whom use the editor at length, making the editor sticky is similarly ineffective, as the system almost always finds the program running elsewhere. For single user systems it is of course quite valuable. I have found the sticky bit useful on programs that are often used, but for short periods of time, such as test and expr, compiler passes, and programs of that nature. On the whole, the sticky bit is unnecessary. I doubt that it has any significant effect on paging systems at all, which may in fact ignore it. A question that intrigues me, however, is why in Xenix-386 (a paging system) the disk is always physically accessed when a process is started? Accounting in this case is turned off. When I run a program while the system has lots of free memory, a small program, and given the same data set as used by another currently executing invocation of the program, I would have thought that everything that has to be read would be in the buffer cache, or in a memory resident text segment. But the disk light always flashes. Why? Neil Erskine -- Neil S. Erskine MT&T - (902) 453-4915 x340 AP Computers USENET { garfield, watmath, ihnp4!utzoo!utai, 3845 Dutch Village Rd. uunet } !dalcs!force10!erskine Halifax, N.S. B3L-4H9