| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | file handles |
Original from Phil Crown to Paul Edwards on 11-12-1996
Original Subject: file handles
---------------------------------------
JdeBP> The 44 file limit sounds like the default per-process
JdeBP> file table size of 50,
> Default is 20.
JdBP> Wrong. I wrote a program to test it. It is definitely 50 by default.
JdBP> The CP Reference is wrong.
PE> I can program too, and my test shows 20 (actually, it shows even less,
PE> but that's likely because of device drivers).
PE> You likely have device drivers that are increasing the number of file
PE> handles available to all processes. Try booting off your OS/2 3.0
PE> floppies and pressing escape at the first prompt after reading the
PE> second disk, and then run your program again. I bet it shows <= 20
PC> You're both right. From the Warp 4 CP Reference:
PC>
PC> "The default maximum number of file handles for a process is 50. An
PC> application can change this maximum by using DosSetMaxFH. When this
PC> call is made, all currently open file handles are preserved.
PC>
PC> In the past, the maximum number of file handles was 20. If you
PC> previously had code that increased the maximum file handles from 20 to
PC> less than 50, you can now remove this code."
PC>
PC>
PC> So I guess it depends on which version of OS/2 you're running.
Interesting.. I looked inside a Warp 4 dump, and the size of the
JFN_TABLE is still the same as under Warp 3. So either the Warp 4 CP
Ref is wrong, or there is additional code to "automaticly" increase
the handle count (and allocate a new JFN_TABLE) as soon as you go
beyond 20 handles.
A simple test would be to use the process dump facility (discussed
earlier here) and dump the process at various times after multiple
file opens. Use the PMDF dump formater to analyze the Pdump.000 (or
001, 002, etc).
The PTDA is dumped as part of the pdump. The PTDA is alaised into
selector 30 while a process is in control (performance reasons) and
starts at 30:F9FC (for Warp 4 only). All references to offsets inside
the PTDA are usually based off 30:0. The actual PTDA flat address is
listed with the .P command.
At PDTA+5C0 (JFN_PTABLE) is the 16:16 pointer to JFN_TABLE. If it
still references 30:FD92 (for warp 4 - Bldlevel 9.023), then JFN_TABLE
is still inside the PTDA and limited to handles for the size of that
table. It still looks like a max 20 handles (40 decimal bytes) for
Warp 4. There is also a word at PTDA+5BE which has a lable of
JFN_LENGTH which might supply another clue. For those interested (and
don't want to do the math) the JFN_TABLE default address is at
PTDA+396. The next lable after that is at PTDA+3BE and called
JFN_FLAGS.
If someone wants to try this (missing a compiler is starting to be a
pain on this laptop) and report back, I would be interested. Watch out
that your runtime library does not set a maxfile handle value before
your code gains control. If it does, you will see a new value for
JFN_PTABLE with a new selector and an offset of 0000 in the dump.
Denis
All opinions are my very own, IBM has no claim upon them
.
.
.
--- Maximus/2 3.01
* Origin: T-Board - (604) 277-4574 (1:153/908)SEEN-BY: 50/99 270/101 620/243 625/160 711/401 409 410 413 430 808 809 934 SEEN-BY: 711/955 712/407 515 624 628 713/317 800/1 @PATH: 153/908 8086 800 270/101 712/515 711/808 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.