vi & heavy loads

Robert_Toxen%anvil.UUCP at harvard.arpa Robert_Toxen%anvil.UUCP at harvard.arpa
Sat Jul 12 15:10:52 AEST 1986


A simple solution that I've implemented to allow reasonable response for
vi on a system with heavy loads such as lots of compiles and nroffs is
as follows.

Rename vi vi_foo. Create a program called vi, set-UID to root that boosts
its niceness to -10 and lock itself into core (for those UNIX versions
allowing such things), set its effective UID to its real UID, and exec
vi_foo with vi's arguments.

Even with those versions of UNIX that don't explicitly have the "lock in
core" feature you can fake it by copying code from ps that will find a
process's process table entry and find its flag word. Then turn on one
of the lock bits, perhaps the one for "lock in core for pending physical I/O".
Since vi doesn't do such things, this bit won't be cleared and viola you've
implemented the feature.

I don't have the source any more.

Bob Toxen
Stratus Computer
{ucbvax!ihnp4,harvard}!anvil!bob        (Please use THIS address to reply)
"panic: can't happen"



More information about the Comp.unix.wizards mailing list