home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / vms / 17768 < prev    next >
Encoding:
Text File  |  1992-11-10  |  1.9 KB  |  49 lines

  1. Newsgroups: comp.os.vms
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!pa.dec.com!nntpd2.cxo.dec.com!adserv.enet.dec.com!winalski
  3. From: winalski@adserv.enet.dec.com (Paul S. Winalski)
  4. Subject: Re: sys$hiber/sys$wake problems?
  5. Message-ID: <1992Nov11.031322.4195@nntpd2.cxo.dec.com>
  6. Lines: 36
  7. Sender: usenet@nntpd2.cxo.dec.com (USENET News System)
  8. Reply-To: winalski@adserv.enet.dec.com (Paul S. Winalski)
  9. Organization: Digital Equipment Corporation, Nashua NH
  10. References: <BxIAFn.2p6@unx.sas.com> <1992Nov10.180054.23127@fripp.ri.cadre.com> <BxIrqM.2pF@unx.sas.com>
  11. Date: Wed, 11 Nov 1992 03:13:22 GMT
  12.  
  13.  
  14. In article <BxIrqM.2pF@unx.sas.com>,
  15. sasjzs@falcon.unx.sas.com (Joseph Slater) writes:
  16.  
  17. [discussion of problem with $HIBER wait being terminated unexpectedly, PPL$
  18.  routines suspected]
  19.  
  20. |>My next task is to try to trap calls 
  21. |>to sys$wake from the main and sharable images. Any ideas on 
  22. |>doing this? I may have a hard time convicing our system manager 
  23. |>to let me patch the system service vectors. Read that as slim to none. 
  24.  
  25. Don't bother.  Your conjecture that PPL$ library routines are doing the $WAKE
  26. is most likely correct.  PPL$ is within its rights to use the $HIBER/$WAKE
  27. mechanism.
  28.  
  29. If your application cannot tolerate spurious $WAKEs, then it is not properly
  30. coded.  A piece of code that is event-driven and uses $HIBER should be coded
  31. as follows:
  32.  
  33.     while (1)
  34.     {
  35.     while (there are things to do)
  36.         do the next work item;
  37.  
  38.     SYS$HIBER();
  39.     }
  40.  
  41. A structure such as this insures that, if the process awakens from the $HIBER
  42. when there are no work items, it will go back into hibernation again.  The
  43. semaphore nature of $WAKE (that a $HIBER returns immediately if a $WAKE was
  44. issued while not in HIB state) insures that if an AST adds a work item to the
  45. work queue and does a $WAKE while the main program has left the inner while,
  46. but has not yet issued the $HIBER, the program will not stall.
  47.  
  48. --PSW
  49.