[mod.computers.vax] sleep

Dale.Moore@PS2.CS.CMU.EDU (07/01/86)

Bill Bogstad writes...
>	I actually had to program in FORTRAN (heaven forbid) on VMS and
> had to do the equivalent of a Unix sleep() call.  Sounds reasonable
>right?  Hah!  After spending 3-4 hours wading through the VMS manuals I
>discover that I have to do a "scheduled wakeup" for my process and then
>a "hibernate".  Of course there are optional arguments to both calls
>which I have to decipher.  In addition, I have to call a special routine
>to generate the correct arguement to the wakeup call.  Now, I realize
>that this is somewhat similiar to the internals of the Unix sleep()
>function, but isn't it nicely packaged?  You give it a number and your
>program pauses for the required number of seconds.  Obviously not
>everything is conceptually this easy, but when it is why make it so
>hard to do?

Why didn't you use LIB$WAIT (seconds)?  The VMS runtime library
routine LIB$WAIT places the current process into hibernation for the
number of seconds specified in its argument.  It is not really as
hard as you make it out to be.

	Dale.Moore@PS2.CS.CMU.EDU

DCATHEY%MCRAD2%ti-eg.CSNET@CSNET-RELAY.ARPA.UUCP (07/03/86)

	You're right, VMS does not have a specific sleep() function.
The VMS system calls are much more general than that.  However, a
quick look in the Run-Time Library Reference Manual and you will see
a routine called LIB$WAIT.  This provides a the same functionality as
sleep() and a little more.  It is also usable from any language (as are
all the RTL routines).

	If you *really* want to use sleep(), you can try this:

		EXTERNAL	C$SLEEP
		INTEGER*4	seconds
		CALL C$SLEEP(%VAL(seconds))

	and link with the VAX C RTL.


						David Cathey
						Texas Instruments

[I don't work here, I'm just employed...]

bogstad@HOPKINS-EECS-BRAVO.ARPA.UUCP (07/05/86)

[please read *'ed section]

              Since I posted my message about my problems with VMS
      libraries, I have received many messages both from this list and
      directly which inform me of the LIB$WAIT library function which
      provides exactly the same capability (actually a little better) as
      the Unix sleep() library function.

              In my original posting I failed to mention that I had this
      problem ~3 years ago.  One of the messages I received said that
      LIB$WAIT was added in VMS V4 so in fact it wasn't available when I
      needed it.  That message makes me feel better because I really
      would have hated to think I missed it after spending a day with
      the VMS manuals.  I'm glad that VMS programmers now have the
      benefit of this routine, but since I haven't used VMS for almost
      that long it no longer affects me.

              Many messages could be exchanged about why Unix had a
      sleep() routine years -- my PWB Unix 1.0 manual has it 1977 --
      before VMS.  Obviously different systems have different strengths.
      The VMS RMS library is far beyond anything that comes with
      standard Unices - not of course that it can't be done, as LIB$WAIT
      was done for VMS.

              Unfortunately that was the only time in my use of VMS that
      I had to "escape" from the confines of the Fortran 77 standard and
      I am left without another good example to support my opinion.  This
      opinion being that VMS is a programmer unfriendly system.  In my
      original posting I intended to question the need for the
      baroqueness of the system and library routines of VMS.  My feeling
*     is that simple things should be available in a simple fashion.
*     Realizing of course that not everything is simple.
*
*             Does anyone else have a similiar opinion?  Either of VMS
*     or operating systems in general.

              Finally, this message barely belongs in INFO-VAX a.k.a.
      mod.computers.vax.  On the USENET side, mod.os might be more
      appropriate.  Unfortunately, I am not aware of an ARPANET mailing
      list with an equivalent charter.  I will leave it up to the
      readers of this list to decide whether this subject belongs here
      any longer.  I will watch mod.os if anyone wants to start it
      there.  In either case, I'm afraid that I may have little new to
      add since my experience is primarily limited to VMS and Unix.

      				Bill Bogstad
      				bogstad@hopkins-eecs-bravo.arpa

PKARP@SRI-IU.ARPA (Peter Karp) (07/07/86)

I agree in principle that VMS system calls are much too complex,
particularly in comparison with Unix system calls.  You picked an
unfortunate example and I think people jumped on you for the hell
of it without giving the principle itself the thought it deserved.
Figuring out how to use a new VMS system call is like pulling teeth;
on Unix it's usually cake.

This is not to say that I "prefer Unix to VMS".  Both have lots of
different strengths and weaknesses.  I happen to think that VMS
plus Eunice is a nice combination since you can pick and choose the
strenghts of either (or both) to solve a particular problem.

Peter Karp
PKarp@Sri-IU.Arpa
-------