home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!cadreor!fripp!cadre.com!rj
- From: rj@cadre.com (Rob deFriesse)
- Newsgroups: comp.os.vms
- Subject: Re: sys$hiber/sys$wake problems?
- Message-ID: <1992Nov10.180054.23127@fripp.ri.cadre.com>
- Date: 10 Nov 92 18:00:54 GMT
- Article-I.D.: fripp.1992Nov10.180054.23127
- References: <BxIAFn.2p6@unx.sas.com>
- Sender: usenet@fripp.ri.cadre.com (USENET News Poster Account)
- Reply-To: rj@cadre.com
- Organization: Cadre Technologies Inc.
- Lines: 56
- Nntp-Posting-Host: 192.9.200.166
-
- sasjzs@falcon.unx.sas.com (Joseph Slater) writes:
- :
- : Hi folks,
- : I have an application that hibernates and is awakened by ast
- : routines that call sys$wake. The details are far too complicated
- : to get into here, but the calls to wake frequently happen about
- : time the call is made to sys$hiber. Has anyone ever seen a sys$hiber
- : return when there is (or should be) no outstanding sys$wake?
- :
- : Any advice will be appreciated. Any heckling will be ignored.
- : Joe Slater
- : sasjzs@vms.sas.com
- : Mine opinion is mine only.
-
- In the System Services manual under the section on $HIBER you will read the
- following paragraph.
-
- If one or more wakeup requests are issued for the process while it is not
- hibernating, the next hibernate call returns immediately; that is, the
- process does not hibernate. ...
-
- This is, in fact, the correct behavior for a semaphore. If it doesn't work
- this way, your process could block indefinately.
-
- It is always a good idea to place your $HIBER in a loop that terminates when
- the true wakeup condition occurs. For example:
-
- static int flag;
-
- void
- ast_handler (int astprm)
- {
- flag++; /* set before WAKE call */
- SYS$WAKE (0, 0);
- }
-
- ...
-
- flag = 0; /* Assumes no ASTs queued */
- SYS$QIO ( ... ); /* specifies ast_handler */
-
- ...
-
- while (!flag)
- SYS$HIBER ();
-
- ...
-
- --
-
- Rob deFriesse Mail: rj@cadre.com
- Cadre Technologies Inc. Phone: (401) 351-5950
- 222 Richmond St. Fax: (401) 351-7380
- Providence, RI 02903
-
- My opinions are my own and do not represent the position of Cadre in any way.
-