From: sapsadeb@UHSFIN.UHSA.UH.EDU (David Bratton)
Subject: Re: "fork" in OpenVMS C compiler
Date: 1996/03/09 [thread overview]
Message-ID: <4hr635$iig@masala.cc.uh.edu> (raw)
In-Reply-To: 4hq7p6$nv0@blixen.aquilagroup.com
In article <4hq7p6$nv0@blixen.aquilagroup.com>, wombat@barq.aquilagroup.com (Christopher M. Conway) writes:
>
>About 5 or so years back, I was doing a very similar thing-- porting a shell
>interpreter from a Sun running SunOS 4.1 to a VMS 5.3 system.
>
>I went through *hell* with getting child processes going, and never did
>get them in a way I was happy. VMS (at least at the time, 6.x may be
>different) really didn't like to spawn new processes.
>
>I ended up having to right my own fork function, using their degenerate
>one, as I recall. I believe the end result was that I had to run a
>system(2) call on "spawn/detach program.exe" to get a new program forked.
>I then had to open a pipe to it to pass execution information on. It was
>really ugly and slow as molasses-- took as much as 3-4 *seconds* to spawn a
>new process.
>
>If you just want a forked copy of the parent process, with the same
>environment, you're basically out of luck.
>
>Again, this is as of VMS 5.3. Things may have changed; hopefully some
>VMS wizard will tell me/you of some really simple and efficient way to
>do it, but I doubt it. VMS just doesn't like process spawning.
>
>I'd be happy to dig up my old code for you if you like. Like I said, it's
>not pretty, but it worked.
>
>--
>Christopher M. Conway wombat@aquilagroup.com
>
>Don't Tread on Me
If you had bothered to pick up and read an RTL manual you would have saved
yourself a lot of frustration. The library routine to create a sub-process
is LIB$SPAWN. To do it from DCL the command is SPAWN. The /NOWAIT or
/DETACH qualifiers are used to get the two processes to run asynchrously.
Most environment information is inherited by the new process. Logical names
created with the /JOB qualifier are shared between parent and child process
via a common logical name table.
You can also create processes via Decnet -
ie. nodename"userid password"::TASK=command-procedure.
You can also RUN SYS$SYSTEM:LOGINOUT.EXE/lots-of-qualifiers.
You can also use the system service $CREPRC.
SHEESH!!! Did you really have trouble with this?
David Bratton
University of Houston System
DBratton@uh.edu
------------------------------------------------------------------------------
David Bratton
University of Houston System
DBratton@uh.edu
next prev parent reply other threads:[~1996-03-09 5:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4hk71r$76o@graph24.unipv.it>
1996-03-08 5:00 ` "fork" in OpenVMS C compiler David Bratton
[not found] ` <4hq7p6$nv0@blixen.aquilagroup.com>
1996-03-09 5:00 ` David Bratton [this message]
1996-03-11 5:00 ` Christopher M. Conway
1996-03-13 5:00 ` Carl J. Appellof
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox