Too Many Open Files (was Re: The CLOSE command)
Kenneth Brody
kenbrody at bestweb.net
Fri Feb 17 20:54:27 PST 2006
Quoting Fairlight (Fri, 17 Feb 2006 19:57:33 -0500):
> This public service announcement was brought to you by Jeff Harrison:
> >
> > Ah, but why not have filepro do it automatically?
> > There are many instances where filepro does the
> > reasonable thing - such as automatically protecting
> > lookups when a write occurs.
>
> Erm...then what's the -p for in the lookup statement? Would it not
> then be superfluous?
filePro's automatic locking of an unprotected lookup when you modify
one of the lookup fields is merely an attempt to reduce the target
size when you're shooting yourself in the foot. It doesn't prevent
two people from updating the same record at the same time, it just
reduces the odds.
In retrospect, the "reasonable thing" to have done was to make it a
fatal error. :-)
Only locking the record at lookup time guarantees that only one person
can update the record at the same time.
[... "close-happy" ...]
> CLOSE() is -not- just for the system-level language programmer (C,
> etc.). It's a good practise to use as few resources as possible at
> any given point in -any- environment. Doing so leads to faster,
> leaner, more efficient software.
However, if you are going to use the same file again in the not-too-
distant future, the overhead of closing and opening the file again
may far outweigh the "leanness" you get by closing it. There really
is no empirical answer to "should I close this file which I know I
will be using again later?" Both the "never close the file, just in
case" method and the "close it immediately, regardless" method are
too extreme.
[...]
--
KenBrody at BestWeb dot net spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com
More information about the Filepro-list
mailing list