*BSD News Article 65254


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!newshost.telstra.net!act.news.telstra.net!psgrain!news.sprintlink.net!news.aus.sig.net!news.cfi.org!zilker.net!newshost.convex.com!news.duke.edu!news.mathworks.com!uhog.mit.edu!news.mtholyoke.edu!nntp.et.byu.edu!news.caldera.com!park.uvsc.edu!usenet
From: Terry Lambert <terry@lambert.org>
Newsgroups: comp.os.linux.development.system,comp.unix.bsd.freebsd.misc
Subject: Re: Ideal filesystem
Date: 5 Apr 1996 05:36:16 GMT
Organization: Utah Valley State College, Orem, Utah
Lines: 34
Message-ID: <4k2bgg$j8e@park.uvsc.edu>
References: <4hptj4$cf4@cville-srv.wam.umd.edu> <4j0bmo$ftv@park.uvsc.edu> <wszq8switu.fsf@orcus.ping.at>
NNTP-Posting-Host: hecate.artisoft.com
Xref: euryale.cc.adfa.oz.au comp.os.linux.development.system:20823 comp.unix.bsd.freebsd.misc:16798

robbe@orcus.ping.at (Robert Bihlmeyer) wrote:
] This misfeature is simple to fix (i.e. no big overhead): 
] Make the shell go further down the $PATH if execution failed (due to
] unknown exec-format, missing a.out-component, whatever). The first
] successfully executed file is written into the hash table.

This fails in the case of negative hit.

Specifically, I have to exhaustively search for any non-existant
command each time it is entered because it might have been added
to a directory in my path promiscuously (as the result of an
action about which my shell can not possible be aware -- like
I saw root install the thing on another terminal, etc.).

A positive hit for a non-cached entry requires that I search,
on average, 50% of all potential directories in my path.

A negative hit for a non-cached entry means I much search them
all (to verify non-existance).


The point of a hash is more a quick negative response, since
for a given absolute path, each directory comonent requires an
average of a 50% traversal of a directory for each path component.

A fast positive response has value, but less value than a fast
negative response.


                                        Terry Lambert
                                        terry@cs.weber.edu
---
Any opinions in this posting are my own and not those of my present
or previous employers.