home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 8 Other
/
08-Other.zip
/
pmqsiz.zip
/
PMQSIZ.DOC
< prev
next >
Wrap
Text File
|
1995-04-25
|
11KB
|
245 lines
---- The PM Queue Size Patch -----
SUMMARY:
These patches may provide tremendous stability in OS/2 systems
that suffer from desktop hangs, no-input in shells, invalid switching
between the desktop and Window/DOS applications, and other
ailments. These patches are not meant to be a complete OS/2 fix,
but may be lots of help.
-------------------------
THEORY:
Every PM thread that sends PM messages or receives posted
messages must have a queue to hold those messages until they are
processed. Messages are very frequently put into those messages queues
to be processed as the thread is able. If more messages are put into
the queue than the queue can hold, then it is reasonable to expect
problems in the system, ranging from trivial glitches to system
hangs. The default size for these queues in OS/2 is only 10 messages.
This seems very small considering the number of message-generating
activities going on in a busy OS/2 system.
Many OS/2 users experience problems in running OS/2 that I speculate
are caused, or at least exacerbated, by this too-small queue.
-------------------------
HOW THIS PATCH WORKS:
To test if this is really a serious problem, I have developed the
tools you are receiving now to attempt to force queue sizes to
be larger than the OS/2 default. These patches work by overriding
the size that applications specify for their queues,
instead using a specified number that I recommend should be
much bigger than 10.
These tools do not alter every system queue, and they are limited
in which queues can be changed and how big they can become. Even
with these limitations, if these patches result in a decrease in
the number of desktop problems occuring in an OS/2 system, then
I think we can assuredly recommend to IBM that they revisit
this 10-queue problem and provide for us a *real* fix. For me, with
my limited tools and absolutely no access to the OS/2 source code,
these patches were difficult to create. To IBM engineers with the
source code and great knowledge of OS/2, implementing this fix would
be absolutely trivial. Lets hope for an official solution soon.
-------------------------
THESE FILES:
The files included here are:
PMQSIZ.DOC - this file
PMQSIZE.EXE - Warp patch for 32-bit PM-queue creation calls
PMWPTCH.CMD - 2.11 patch for 32-bit PM-queue creation calls
DMPQUEUE.CMD - Tool to view the code begin patched
WINQLIST.CMD - Tool to show processes and queueu sizes
The *.CMD files here require use of my CEnvi for OS/2 scripting
language, which you can find as shareware as CENVI2.ZIP on
CompuServe in OS2USER library 4, on internet at ftp.std.com in the
/vendors/CEnvi-Cmm/share directory, or on many bulletin boards.
These files have been tested with version 1.009 and 1.010 of
CEnvi for OS/2, but I've no reason to believe they wouldn't
work with earlier versions. CENVI2.ZIP is shareware, and so
you can use it under the shareware principles for up to 30
days without paying, which will certainly be long enough to
use it to apply these patches. PMQSIZE.EXE is a compiled program
and doesn't use CEnvi because if you use this patch then you
must use it every day, and I thought it would be a dirty marketing
gimmick to force you to purchase CEnvi just to fix this one
problem. (I'd certainly like everyone to try CEnvi, of
course, since this is my bread and butter, how I pay the bills,
feed the kids, etc... <g>)
-------------------------
APPLYING THE PATCH:
APPLYING THE PATCH FOR WARP: The Warp queue patch is PMQSIZE.EXE.
Running PMQSIZE without any arguments will give a short USAGE
description. PMQSIZE alters the image in memory of the 32-bit
WinCreateMsgQueue() call. It must be applied after PMSHELL has
started, but as soon after as possible. Assuming that you've
installed PMQSIZE.EXE in the directory C:\PMQTOOL, and that you
boot from drive C, I recommend that you put a line like this as
the first line in C:\STARTUP.CMD:
C:\PMQTOOL\PMQSIZE.EXE C:\OS2\DLL\PMWIN.DLL 223
If you don't already have a file C:\STARTUP.CMD then create it
with any text editor and make this file:
C:\PMQTOOL\PMQSIZE.EXE C:\OS2\DLL\PMWIN.DLL 223
EXIT
An option to installing in STARTUP.CMD, is to add a line as
THE LAST LINE IN CONFIG.SYS as follows:
RUN=C:\PMQTOOL\PMQSIZE.EXE C:\OS2\DLL\PMWIN.DLL 222
I haven't determined that this CONFIG.SYS method will work on
all systems, but it does work on mine and many others. If
you want to be sure you can use both the CONFIG.SYS method and
then STARTUP.CMD method--it won't hurt to do both.
You can later use WINQLIST to determine if this patch "took hold".
If you want to test PMQSIZE before putting it into STARTUP.CMD
then just run from a command line, then start E.EXE and run
WINQLIST.CMD too see if E.EXE has the queue size you specified
with PMQSIZE.EXE, if so then add to first line of STARTUP.CMD
and reboot. The maximum size PMQSIZE.EXE accepts is 255.
Note: PMQSIZE.EXE should be executed from STARTUP.CMD, not from
the STARTUP folder of WPS. If you don't already have a STARTUP.CMD
file on your boot drive then create it with any text editor and
add the call to PMQSIZE.EXE as the first line.
The PMQSIZE.EXE patch for Warp can be used dynamically at any time
to change the size of queues being created. If you're about to
start a program that wants smaller queues, then you may want to
run PMQSIZE with a smaller queue size before starting that program,
then run again after starting the program with the old larger size.
If the queue size specified is 0, then the code reverts to the
original Warp default queue method, if the size is between 1 and
127 (inclusive) then PMQSIZE will use one method for queue sizes,
and between 128 and 255 (inclusive) PMQSIZE will use another
method. It hasn't been shown yet whether either method
presents a problem where the other may not.
APPLYING THE PATCH FOR 2.11 (and possibly 2.1x). The 2.11 patch
is PMWPTCH.CMD. Running PMWPTCH.CMD without any arguments gives
a short usage description. This patch alters the binary file
PMWIN.DLL to change the 32-bit WinCreateMsgQueue() call. Because
it alters PMWIN.DLL it will not work while OS/2 and PMSHELL are
running, because then PMWIN.DLL is being used, and so you must
apply this patch to a PMWIN.DLL that is not being used. To do so
you should first make a backup copy of your PMWIN.DLL
file and save it somewhere safe. I REPEAT, MAKE A BACKUP COPY OF
PMWIN.DLL and put that copy in a safe place. Then copy PMWIN.DLL
to a temporary location, for example:
COPY C:\OS2\DLL\PMWIN.DLL A:\
then apply this patch to the copy. For example:
PMWPTCH C:\PMWIN.DLL 222
Now boot OS/2 from a floppy (use installation floppies if you
haven't created boot floppies), and copy the patched file back
to the original location. Example:
COPY C:\PMWIN.DLL C:\OS2\DLL
When you reboot, you can later use WINQLIST to determine if this
patch "took hold". The maximum size PMWPTCH.CMD accepts is 255.
DMPQUEUE.CMD - This will display the binary code around the running
WinCreateMsgQueue() call. If you're a geeky programmer like myself
then you can decode these binaries to see what code the patch
replaces. If these patches don't work on your system then we may
be able to figure something out together by looking at the output
of DMPQUEUE.CMD.
WINQLIST.CMD - This will display the PM windows on your system and
information about the queues they use. You can use this before running
the patch to learn about what programs use how many windows and
what queue sizes. After applying the patch then this program will
let you know if the patch worked. For example, if you specify the
size of 111 in PMQSIZE.EXE or PMWPTCH.CMD, then run WINQLIST and all
of the queues that are affected by the patch will have a size
of 111. If no queues have this size then the patch didn't work.
Other queue sizes than 111 indicate either a call to the 16-bit
version of WinCreateMsgQueue(), which these tools don't attempt to
patch, or a queue created by some lower-level method.
-------------------------
REMOVING THE PATCH:
To remove the 2.11 version of this patch (PMWPtch.cmd),
reboot from floppy and replace the patched version of PMWIN.DLL with the
original you saved before applying the patch. To undo the Warp
version of this patch (PMQSIZE.EXE) just remove or comment-out the
call to PMQSIZE.EXE in STARTUP.CMD and CONFIG.SYS and reboot.
-------------------------
THANKS:
Thanks to all the testers who tried this patch, reported their
problems and successes, helped with the tedious process of
remote-debugging, and suffered through a few non-bootable versions
(you know who you are). Thanks to Watcom for making a compiler IDE
that is so very likely to hang WPS on large projects unless this
patch is applied. Thanks to Creative Systems Programming Corporation
for making, in the form of Golden CommPass, a system-hanging program
that was so darn good that I felt compelled to figure out why it hung
instead of just dumping the program (as I would have done with any other
program that causes so many hangs). And thanks, finally, to IBM for
supplying this challenging puzzle hidden within a great operating
system.
-------------------------
DISCLAIMERS:
I am not affiliated with IBM. This patch was not created by IBM, and
is not supported by IBM. With this patch you are altering the
operating system. IBM will not take problem reports from users with
this patch installed on their system.
I've done my best to keep these patches safe; all versions of the patch
attempt to determine that the patched area is valid by comparing memory
against expected values, and will not patch if it looks wrong. If these
patches cause any damage then don't blame me. I accept no responsibility
for badness; I'm only trying to help. Note that because this patch sets
the queue size to a fixed value, it may actually be reducing the queue
size for applications that are requesting a size larger than that fixed
value. Also, in a few circumstances a trap has been reported after
applying the 2.11 version of this patch, but these reports have not been
reproducible. The CEnvi UNHANG utility does not cooperate well with
this patch, and so you should stop using UNHANG while you're using
this patch (hopefully, this patch makes UNHANG unnecessary anyway).
If you find that these patches don't work, or cause errors then please
let me know. If you do experience errors then remove the patch following
the "REMOVING THE PATCH" instructions above. If your version of OS/2 is
not supported by these patches then let me know and with your help I can
try to add a new version.
You may freely distribute these files as long as you keep all the files
listed together in the same package, and make no alterations without
first getting my approval.
Good Luck.
-------------------------
Brent "Hung no more" Noorda
Nombas, Inc., President
(617)391-6595
bsn@world.std.com
CIS: 72212,1622