TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Jonathan de Boyne Pollard
from: Peter Fitzsimmons
date: 1996-07-31 16:38:48
subject: profile

> Starting with one of the OS/2 2.1 fixpaks,t
  > ini files started working in a substantially different way
  > (that I disagree with;  but I digress). [...]
  >
  > The system never actually writes directly to the *.ini's
  > anymore,it keeps stuff in memory,  then,  when it decides
  > to take a dump,it writes them out to files like "os2.!!!",
  > then erases os2.ini and renames os2.!!! to os2.ini.
PF>

 JdBP>   Strictly speaking, this isn't quite what is happening.

 JdBP>   If you write a program that accesses the user or 
 JdBP> system INI files, then
 JdBP>   that program will access those files directly, and 
 JdBP> all changes will be
 JdBP>   reflected immediately.

Actually,   when you use the Prf...() API's,  with the exception of
PrfOpenProfile(),  the *.ini files are not accessed -- they are held
compleltely in memory and your program uses the in memory copy.  When a
program changes an ini value,  a lazy-thread will eventually write out the
whole file (thus touching all of its pages and causing swapping; I hate
this whole thing!) to xxxx.!!!,  and does the rename to xxxx.ini.

This can easyily be watched if you've got the source code to a file system
and watch what is happening real time.

This change was made just before 2.1 came out (with a fixpak for 2.0),to
"enhance performance" (which it does while booting,  but in the
long run I think it degrades it).  I might be wrong about the version
numbers (it may have been a change between 2.1 and 2.11).

Further,  the *.!!!'s are opened with the
"OPEN_FLAG_WRITETHROUGH" bit set (I can see *no* reason for this,
with the new in-memory technique),and the DosWrites() are always for around
48k of data --- which causes quite a "chug chug chug" of the hard
disk over here,  every few mins when os2.ini is rewritten.  This bothered
me so much that I forwarded pmmerge.dll's DosOpen to my own dll,  where I
turn that flag off.  Now my *.ini's are written instantly (and flushed by
the cache 500ms later;which means the file gets to disk at least 5 times
faster than with OPEN_FLAG_WRITETHROUGH set).



 JdBP>   In older versions of Workplace Shell, whenever an abstract object
 JdBP>   changed its persistent data, that change would be 
 JdBP> stored immediately to
 JdBP>   the INI file.  In OS/2 2.11 this was changed so that changes were
 JdBP>   buffered in memory.

This is correct -- but the change was made to the Prf...() apis,  not Wps.


 JdBP>   In parallel with this buffering, another change was made so that WPS
 JdBP>   wrote all batched changes to a a copy of the 
 JdBP> system and user INI files,

They don't write just the changes,  the write the whole thing.  And it is
for all *.ini files,  not just os2*.ini.


--- Maximus/2 3.00
* Origin: Sol 3 * Toronto * V.32 * (905)858-8488 (1:259/414)
SEEN-BY: 50/99 270/101 620/243 625/100 711/401 409 410 413 430 808 809 934
SEEN-BY: 711/955 712/407 515 624 628 713/888 800/1
@PATH: 259/414 400 99 250/99 3615/50 396/1 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™.