Hej!
Does anybody know whether Prf* routines are usable from inside a
window proc? Do they block or violate the 1/10s rule in any other
way?
Currently I'm using my own Profile routines which are working on
memory structures and dump the new contents to disk whenever WM_SAVEAPPLICATION is called. If PrfReadProfileData /
PrfWriteProfileData routines use the same scheme (i.e no file
access) it would double the memory requirements without need.
Does anybody know whether Prf* routines are usable from inside a window proc? Do they block or violate the 1/10s rule in any other way?
Does anybody know whether Prf* routines are usable from inside a
window proc? Do they block or violate the 1/10s rule in any other
way?
Currently I'm using my own Profile routines which are working on
memory structures and dump the new contents to disk whenever WM_SAVEAPPLICATION is called. If PrfReadProfileData /
PrfWriteProfileData routines use the same scheme (i.e no file access)
it would double the memory requirements without need.
But even if the user selected a network drive it would hang the
PM if the network fails and my program uses PrfWriteProfileData()
from WM_MOVE.
But even if the user selected a network drive it would hang the
PM if the network fails and my program uses
PrfWriteProfileData() from WM_MOVE.
OH NO! Post a WM_USER or use WM_SAVEAPPLICATION for that. WM_MOVE
is the wrongest place you can find for that.
So the current design will not change: WM_MOVE updates memory
structures about the profile contents
Absolutly needless!
and WM_SAVEAPPLICATION uses PrfWriteProfileData() to dump the
changed entries to disk.
WinQueryWindowPos() for frame window size and position does the
same without having any overhead on management the info. Only size/position of child windows NOT depending on current FRAME
size are object of separat handling.
Presentation params of each window can inspected at any tim with WinQuerypresParams(), ALL window depending information can be
queried at any time by WinQueryWindowWords(), WinQueryUlong()....
So you never need to hold lists of them by yourself. Any change
the user my do is announced before!
So the current design will not change: WM_MOVE updates memory
structures about the profile contents
Absolutly needless!
No (WM_MOVE is an example, take WM_PRESPARAMCHANGED if this
suites you better).
and WM_SAVEAPPLICATION uses PrfWriteProfileData() to dump the
changed entries to disk.
WinQueryWindowPos() for frame window size and position does the
same without having any overhead on management the info. Only
size/position of child windows NOT depending on current FRAME
size are object of separat handling.
You have to either compare SWPs or set an internal flag on
WM_MOVE. So there is overhead, too.
Presentation params of each window can inspected at any tim with
WinQuerypresParams(), ALL window depending information can be
queried at any time by WinQueryWindowWords(),
WinQueryUlong().... So you never need to hold lists of them by
yourself. Any change the user my do is announced before!
You posted the great idea of subclassing and are now going back
to query all and every window? Doing all this querying was my
major dislike with presentation parameters and you solved it.
I'm not going back.
The subclassing code updates the in-memory-copy of the profile on
any change. On WM_SAVEAPPLICATION the changes are written back (a
very simple WM_SAVEAPPLICATION routine). And remember your saying
about coding same things only once? One function call to add
PRESPARAM or WM_MOVE handling to a control isn't really bad.
Does anybody know whether Prf* routines are usable from inside a
window proc? Do they block or violate the 1/10s rule in any
other way?
I'm using them in a trivial post-it note program without any
problems whatsoever. I'm only saving up to 64KiB, though.
Does anybody know whether Prf* routines are usable from inside a
window proc? Do they block or violate the 1/10s rule in any
other 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.
Currently I'm using my own Profile routines which are working on
memory structures and dump the new contents to disk whenever
WM_SAVEAPPLICATION is called. If PrfReadProfileData /
PrfWriteProfileData routines use the same scheme (i.e no file
access) 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.
So the current design will not change: WM_MOVE updates memory
structures about the profile contents
and WM_SAVEAPPLICATION uses PrfWriteProfileData() to dump the
changed entries to disk.
In general, I do my Prf...() calls in a background thread.
Feeding it via a pipe or [message] queue, i assume?
I should have added that I use PrfWriteProfileData to do this dump in WM_SAVEAPPLICATION.
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.
From the usual discussions about OS2.INI (size and writing strategy) I
was under the impression that OS/2 holds the complete file in memory.
If this were true and PrfOpenProfile is responsible for this caching, PrfWriteProfileData would most certainly *not* block (because it only
has to update the inmemory copy).
What you told me is that
1. PrfWriteProfileData might block (forcing me to keep my design of buffering)
2. PrfReadProfileData will cause some/most of the contents
to remain in memory (cache)
As my design holds a copy of the profile in memory this will double
the memory requirements. Stop. :-(
I'm using them in a trivial post-it note program without any
problems whatsoever. I'm only saving up to 64KiB, though.
Are you using the OS2.INI or your own profile?
But even if the user selected a network drive it would hang the PM if
the network fails and my program uses PrfWriteProfileData() from
WM_MOVE.
Sysop: | digital man |
---|---|
Location: | Riverside County, California |
Users: | 1,043 |
Nodes: | 16 (0 / 16) |
Uptime: | 89:29:15 |
Calls: | 500,953 |
Calls today: | 2 |
Files: | 109,377 |
D/L today: |
1,120 files (199M bytes) |
Messages: | 304,684 |