Newsgroups: comp.bugs.sys5 Path: utzoo!henry From: henry@zoo.toronto.edu (Henry Spencer) Subject: Re: small bug in who(1) of SVR3 Message-ID: <1991Jan14.202053.20054@zoo.toronto.edu> Organization: U of Toronto Zoology References: <9101091725.AA15013@ucbvax.Berkeley.EDU> <1991Jan10.130738.10194@unhtel.uucp> <14818@smoke.brl.mil> <18896@rpp386.cactus.org> <1991Jan13.004843.18650@zoo.toronto.edu> <18899@rpp386.cactus.org> Date: Mon, 14 Jan 1991 20:20:53 GMT In article <18899@rpp386.cactus.org> jfh@rpp386.cactus.org (John F Haugh II) writes: >>Because they are the simplest and cheapest way to get the desired results? > >How can you possibly say that? The amount of machine overhead in the >above case is several times greater than "who -q". In which sense is >it "the simplest and cheapest way"? Add up the costs of writing the C code, the costs of maintaining it, the costs of enhancing it to add the next round of silly "features", and so forth. Now consider how many times per second "who" gets run, and how critical its performance is -- i.e., not very many and not very. The optimization is not worth the price. >... fork() and exec() are neither free nor even cheap - shell >scripts are just not the right answer. Odd; we've found that shell scripts are the right answer for an enormous range of applications. "ls" is a shell script on utzoo (it invokes the Sun ls with the -1 option). The question is not whether fork() and exec() are free -- obviously not -- or cheap -- thanks to manufacturer stupidity and greed, often they aren't -- but whether they are cheap *enough*. The answer is usually "yes". Incidentally, it turns out that one can often rewrite Berkeley or AT&T C programs as shell files and find that they run *faster*. -- If the Space Shuttle was the answer, | Henry Spencer at U of Toronto Zoology what was the question? | henry@zoo.toronto.edu utzoo!henry