Subj : Using Prf* routines in window procs
To : Vitus Jensen
From : David Noon
Date : Sun Jun 04 2000 11:14 am
Hi Vitus,
Replying to a message of Vitus Jensen to all:
VJ> Does anybody know whether Prf* routines are usable from inside a
VJ> window proc? Do they block or violate the 1/10s rule in any other
VJ> way?
They block the thread that calls them. The ones that will violate the 1/10
second rule are PrfOpenProfile() and PrfCloseProfile(), as these will always
perform physical I/O. The others might or might not perform physical I/O
depending on caching of the sectors of the .INI file from previous requests.
In general, I do my Prf...() calls in a background thread.
VJ> Currently I'm using my own Profile routines which are working on
VJ> memory structures and dump the new contents to disk whenever
VJ> WM_SAVEAPPLICATION is called. If PrfReadProfileData /
VJ> PrfWriteProfileData routines use the same scheme (i.e no file access)
VJ> it would double the memory requirements without need.
The Prf...() routines do cache the .INI file quite aggressively, so any
application/key/value that has already been read or written will almost
certainly be accessed again by cache lookaside. These API's seem to offer quite
an efficient way to save and restore an application's settings.
Regards
Dave
<Team PL/I>
--- FleetStreet 1.25.1
* Origin: The man who broke the bank at Monte Carlo (2:257/609.5)