home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / pmqsiz.zip / PMQSIZ.DOC < prev    next >
Text File  |  1995-04-25  |  11KB  |  245 lines

  1. ---- The PM Queue Size Patch -----
  2.  
  3. SUMMARY:
  4.  
  5.  These patches may provide tremendous stability in OS/2 systems
  6.  that suffer from desktop hangs, no-input in shells, invalid switching
  7.  between the desktop and Window/DOS applications, and other
  8.  ailments.  These patches are not meant to be a complete OS/2 fix,
  9.  but may be lots of help.
  10.  
  11.  
  12. -------------------------
  13.  
  14. THEORY:
  15.  
  16.  Every PM thread that sends PM messages or receives posted
  17.  messages must have a queue to hold those messages until they are
  18.  processed. Messages are very frequently put into those messages queues
  19.  to be processed as the thread is able.  If more messages are put into
  20.  the queue than the queue can hold, then it is reasonable to expect
  21.  problems in the system, ranging from trivial glitches to system
  22.  hangs.  The default size for these queues in OS/2 is only 10 messages.
  23.  This seems very small considering the number of message-generating
  24.  activities going on in a busy OS/2 system.
  25.  
  26.  Many OS/2 users experience problems in running OS/2 that I speculate
  27.  are caused, or at least exacerbated, by this too-small queue.
  28.  
  29.  
  30. -------------------------
  31.  
  32. HOW THIS PATCH WORKS:
  33.  
  34.  To test if this is really a serious problem, I have developed the
  35.  tools you are receiving now to attempt to force queue sizes to
  36.  be larger than the OS/2 default.  These patches work by overriding
  37.  the size that applications specify for their queues,
  38.  instead using a specified number that I recommend should be
  39.  much bigger than 10.
  40.  
  41.  These tools do not alter every system queue, and they are limited
  42.  in which queues can be changed and how big they can become.  Even
  43.  with these limitations, if these patches result in a decrease in
  44.  the number of desktop problems occuring in an OS/2 system, then
  45.  I think we can assuredly recommend to IBM that they revisit
  46.  this 10-queue problem and provide for us a *real* fix.  For me, with
  47.  my limited tools and absolutely no access to the OS/2 source code,
  48.  these patches were difficult to create.  To IBM engineers with the
  49.  source code and great knowledge of OS/2, implementing this fix would
  50.  be absolutely trivial.  Lets hope for an official solution soon.
  51.  
  52.  
  53. -------------------------
  54.  
  55. THESE FILES:
  56.  
  57.  The files included here are:
  58.    PMQSIZ.DOC - this file
  59.    PMQSIZE.EXE - Warp patch for 32-bit PM-queue creation calls
  60.    PMWPTCH.CMD - 2.11 patch for 32-bit PM-queue creation calls
  61.    DMPQUEUE.CMD - Tool to view the code begin patched
  62.    WINQLIST.CMD - Tool to show processes and queueu sizes
  63.  
  64.  The *.CMD files here require use of my CEnvi for OS/2 scripting
  65.  language, which you can find as shareware as CENVI2.ZIP on
  66.  CompuServe in OS2USER library 4, on internet at ftp.std.com in the
  67.  /vendors/CEnvi-Cmm/share directory, or on many bulletin boards.
  68.  These files have been tested with version 1.009 and 1.010 of
  69.  CEnvi for OS/2, but I've no reason to believe they wouldn't
  70.  work with earlier versions.  CENVI2.ZIP is shareware, and so
  71.  you can use it under the shareware principles for up to 30
  72.  days without paying, which will certainly be long enough to
  73.  use it to apply these patches.  PMQSIZE.EXE is a compiled program
  74.  and doesn't use CEnvi because if you use this patch then you
  75.  must use it every day, and I thought it would be a dirty marketing
  76.  gimmick to force you to purchase CEnvi just to fix this one
  77.  problem.  (I'd certainly like everyone to try CEnvi, of
  78.  course, since this is my bread and butter, how I pay the bills,
  79.  feed the kids, etc... <g>)
  80.  
  81.  
  82. -------------------------
  83.  
  84. APPLYING THE PATCH:
  85.  
  86. APPLYING THE PATCH FOR WARP: The Warp queue patch is PMQSIZE.EXE.
  87.  Running PMQSIZE without any arguments will give a short USAGE
  88.  description.  PMQSIZE alters the image in memory of the 32-bit
  89.  WinCreateMsgQueue() call. It must be applied after PMSHELL has
  90.  started, but as soon after as possible.  Assuming that you've
  91.  installed PMQSIZE.EXE in the directory C:\PMQTOOL, and that you
  92.  boot from drive C, I recommend that you put a line like this as
  93.  the first line in C:\STARTUP.CMD:
  94.     C:\PMQTOOL\PMQSIZE.EXE C:\OS2\DLL\PMWIN.DLL 223
  95.  If you don't already have a file C:\STARTUP.CMD then create it
  96.  with any text editor and make this file:
  97.     C:\PMQTOOL\PMQSIZE.EXE C:\OS2\DLL\PMWIN.DLL 223
  98.     EXIT
  99.  
  100.  An option to installing in STARTUP.CMD, is to add a line as
  101.  THE LAST LINE IN CONFIG.SYS as follows:
  102.     RUN=C:\PMQTOOL\PMQSIZE.EXE C:\OS2\DLL\PMWIN.DLL 222
  103.  I haven't determined that this CONFIG.SYS method will work on
  104.  all systems, but it does work on mine and many others.  If
  105.  you want to be sure you can use both the CONFIG.SYS method and
  106.  then STARTUP.CMD method--it won't hurt to do both.
  107.  
  108.  You can later use WINQLIST to determine if this patch "took hold".
  109.  If you want to test PMQSIZE before putting it into STARTUP.CMD
  110.  then just run from a command line, then start E.EXE and run
  111.  WINQLIST.CMD too see if E.EXE has the queue size you specified
  112.  with PMQSIZE.EXE, if so then add to first line of STARTUP.CMD
  113.  and reboot.  The maximum size PMQSIZE.EXE accepts is 255.
  114.  Note: PMQSIZE.EXE should be executed from STARTUP.CMD, not from
  115.  the STARTUP folder of WPS.  If you don't already have a STARTUP.CMD
  116.  file on your boot drive then create it with any text editor and
  117.  add the call to PMQSIZE.EXE as the first line.
  118.  
  119.  The PMQSIZE.EXE patch for Warp can be used dynamically at any time
  120.  to change the size of queues being created.  If you're about to
  121.  start a program that wants smaller queues, then you may want to
  122.  run PMQSIZE with a smaller queue size before starting that program,
  123.  then run again after starting the program with the old larger size.
  124.  If the queue size specified is 0, then the code reverts to the
  125.  original Warp default queue method, if the size is between 1 and
  126.  127 (inclusive) then PMQSIZE will use one method for queue sizes,
  127.  and between 128 and 255 (inclusive) PMQSIZE will use another
  128.  method.  It hasn't been shown yet whether either method 
  129.  presents a problem where the other may not.
  130.  
  131. APPLYING THE PATCH FOR 2.11 (and possibly 2.1x).  The 2.11 patch
  132.  is PMWPTCH.CMD.  Running PMWPTCH.CMD without any arguments gives
  133.  a short usage description.  This patch alters the binary file
  134.  PMWIN.DLL to change the 32-bit WinCreateMsgQueue() call.  Because
  135.  it alters PMWIN.DLL it will not work while OS/2 and PMSHELL are
  136.  running, because then PMWIN.DLL is being used, and so you must
  137.  apply this patch to a PMWIN.DLL that is not being used.  To do so
  138.  you should first make a backup copy of your PMWIN.DLL
  139.  file and save it somewhere safe.  I REPEAT, MAKE A BACKUP COPY OF
  140.  PMWIN.DLL and put that copy in a safe place.  Then copy PMWIN.DLL
  141.  to a temporary location, for example:
  142.    COPY C:\OS2\DLL\PMWIN.DLL A:\
  143.  then apply this patch to the copy.  For example:
  144.    PMWPTCH C:\PMWIN.DLL 222
  145.  Now boot OS/2 from a floppy (use installation floppies if you
  146.  haven't created boot floppies), and copy the patched file back
  147.  to the original location. Example:
  148.    COPY C:\PMWIN.DLL C:\OS2\DLL
  149.  When you reboot, you can later use WINQLIST to determine if this
  150.  patch "took hold".  The maximum size PMWPTCH.CMD accepts is 255.
  151.  
  152.  
  153. DMPQUEUE.CMD - This will display the binary code around the running
  154.  WinCreateMsgQueue() call.  If you're a geeky programmer like myself
  155.  then you can decode these binaries to see what code the patch
  156.  replaces.  If these patches don't work on your system then we may
  157.  be able to figure something out together by looking at the output
  158.  of DMPQUEUE.CMD.
  159.  
  160. WINQLIST.CMD - This will display the PM windows on your system and
  161.  information about the queues they use.  You can use this before running
  162.  the patch to learn about what programs use how many windows and
  163.  what queue sizes.  After applying the patch then this program will
  164.  let you know if the patch worked.  For example, if you specify the
  165.  size of 111 in PMQSIZE.EXE or PMWPTCH.CMD, then run WINQLIST and all
  166.  of the queues that are affected by the patch will have a size
  167.  of 111.  If no queues have this size then the patch didn't work.
  168.  Other queue sizes than 111 indicate either a call to the 16-bit
  169.  version of WinCreateMsgQueue(), which these tools don't attempt to
  170.  patch, or a queue created by some lower-level method.
  171.  
  172.  
  173. -------------------------
  174.  
  175. REMOVING THE PATCH:
  176.  
  177.  To remove the 2.11 version of this patch (PMWPtch.cmd),
  178.  reboot from floppy and replace the patched version of PMWIN.DLL with the
  179.  original you saved before applying the patch.  To undo the Warp
  180.  version of this patch (PMQSIZE.EXE) just remove or comment-out the
  181.  call to PMQSIZE.EXE in STARTUP.CMD and CONFIG.SYS and reboot.
  182.  
  183.  
  184. -------------------------
  185.  
  186. THANKS:
  187.  
  188.  Thanks to all the testers who tried this patch, reported their
  189.  problems and successes, helped with the tedious process of
  190.  remote-debugging, and suffered through a few non-bootable versions
  191.  (you know who you are).  Thanks to Watcom for making a compiler IDE
  192.  that is so very likely to hang WPS on large projects unless this
  193.  patch is applied.  Thanks to Creative Systems Programming Corporation
  194.  for making, in the form of Golden CommPass, a system-hanging program
  195.  that was so darn good that I felt compelled to figure out why it hung
  196.  instead of just dumping the program (as I would have done with any other
  197.  program that causes so many hangs).  And thanks, finally, to IBM for
  198.  supplying this challenging puzzle hidden within a great operating
  199.  system.
  200.  
  201.  
  202. -------------------------
  203.  
  204. DISCLAIMERS:
  205.  
  206.  I am not affiliated with IBM.  This patch was not created by IBM, and
  207.  is not supported by IBM.  With this patch you are altering the
  208.  operating system.  IBM will not take problem reports from users with
  209.  this patch installed on their system.
  210.  
  211.  I've done my best to keep these patches safe; all versions of the patch
  212.  attempt to determine that the patched area is valid by comparing memory
  213.  against expected values, and will not patch if it looks wrong.  If these
  214.  patches cause any damage then don't blame me.  I accept no responsibility
  215.  for badness; I'm only trying to help.  Note that because this patch sets
  216.  the queue size to a fixed value, it may actually be reducing the queue
  217.  size for applications that are requesting a size larger than that fixed
  218.  value.  Also, in a few circumstances a trap has been reported after
  219.  applying the 2.11 version of this patch, but these reports have not been
  220.  reproducible.  The CEnvi UNHANG utility does not cooperate well with
  221.  this patch, and so you should stop using UNHANG while you're using
  222.  this patch (hopefully, this patch makes UNHANG unnecessary anyway).
  223.  
  224.  If you find that these patches don't work, or cause errors then please
  225.  let me know.  If you do experience errors then remove the patch following
  226.  the "REMOVING THE PATCH" instructions above.  If your version of OS/2 is
  227.  not supported by these patches then let me know and with your help I can
  228.  try to add a new version.
  229.  
  230.  You may freely distribute these files as long as you keep all the files
  231.  listed together in the same package, and make no alterations without
  232.  first getting my approval.
  233.  
  234.  Good Luck.
  235.  
  236.  
  237. -------------------------
  238.  
  239.  Brent "Hung no more" Noorda
  240.  Nombas, Inc., President
  241.  (617)391-6595
  242.  bsn@world.std.com
  243.  CIS: 72212,1622
  244.  
  245.