[net.micro.pc] 99 files and 20 open files

markz@microsoft.UUCP (Mark Zbiokowski) (09/28/83)

MSDOS 2.0 maintains a set of FCBs for the system that are in the system-space
rather than in the user space.  The number of such FCBs is governed by the
FILES= statement in CONFIG.SYS.  The main advantage to having such FCBs and
other such structures in system space (and undocumented) is that system space
is controlled by the DOS; these structures may change for the benefit of the
DOS/applications without impacting those applications.

Now, as to why FILES=99 does not allow a process to open > 20 files is simple.
This is a fixed limit imposed on each process (created by EXEC system call).
The total number of files open may not exceed the FILES= number. Consider:

    process A opens 20 files
    process A EXECs process B
    process B closes all 20 files
    process B opens another 20 files

at this point, there are 40 files open although each process does not have
more than 20 files open at the same time.  The 20 number is fairly
reasonable: it comes from the default number of handles available under XENIX.

I wonder about applications the 'require' > 20 files open at a particular
time.

preece@uicsl.UUCP (09/30/83)

#R:microsof:-865600:uicsl:7300009:000:1158
uicsl!preece    Sep 29 09:13:00 1983

	I wonder about applications the 'require' > 20 files open at a
	particular time.
----------
I'll give you an easy example of a program that very naturally uses
more than twenty files. Consider the problem of indexing a large
file of text. We have to break out all the individual words and,
subsequently, sort them into lexicographic order. A very useful
method here is the distribution sort. The most obvious way to do it
is to partition the words by first letter. This requires 26 output
files in addition to the input file. Obviously the letters can be
grouped (since they are not equi-frequent), but the most natural way
is to just use the obvious distribution.

Another obvious example is a large database management system in which
relations are separate files. A reasonably complex model, with
attendant index files, could easily get over 20 files.

It's quite possible to have situations where the natural approach
requires a lot of files. Such situations can generally be re-cast
to use a smaller number, but the change usually makes the process
involved less intuitive and therefore less easy to maintain.

scott preece
pur-ee!uiucdcs!uicsl!preece