TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Peter Fitzsimmons
from: Paul Edwards
date: 1996-02-11 10:59:32
subject: pdpclib

PF> What will happen if two or more threads use the 
PF> same 'FILE *' at the same 
PF> time?

PE> Presumably what they deserve.

PF> ; I know what you mean -- but what about stdout/err/in -- surely you 
PF> have to let multiple threads use those; and if they use
PF> global/static/alloc underneath,  those things better be thread safe.

Ok, as far as I can tell, you should be able to write to the same
file at the same time.  However, I have not tested this, because
I am not particularly interested in that, my objective was to make
"normal" text processing applications as fast as possible.

PE> I was using a 7 meg file.

PF> So?

PE> So you want me to run a 7 meg disk cache with HPFS?  The maximum
PE> is 2 meg.  Or are you saying that reading from an HPFS disk is
PE> faster than reading from memory?  I'd like to see that hard
PE> disk!

PF> Try it -- you might be surprised (I am not saying you WILL be;  I'm not 
PF> sure myself -- but I do know that vdisk.sys has "sleep"'s
in it on purpose,  
PF> so as not to impact system performance,  or break latency guidelines).

Ok, I reran this test using my 2 meg HPFS disk cache...

                small freads on binary files
                ----------------------------

pwcc - 3.21 3.20 3.21

The results were:

12.78, 12.62, 12.51

making it almost 4 times as long as the RAM disk.

PF> I once did a test for a non-believer (This was under OS/2 1.3 with hpfs).  
PF> I copied everything necessary to make a program that consisted of a dozen 
PF> or so C files.  I copied the compiler, header files, make files -- 
PF> everything to a ram disk,  then to a hpfs partition.  HPFS beat the pants 
PF> off the ramdisk,  even when the HPFS cache was slightly smaller than the 
PF> sum of all the files involved.

You might want to let the non-believer know that he should rerun
the test under OS/2 2.1 to make sure the situation hasn't changed!

BFN.  Paul.
@EOT:

---
* Origin: X (3:711/934.9)

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™.