↑ On-the-Shelf Software ↑

GEONius.com
23-Dec-2015
 E-mail 

prosper - Process Spawner

prosper is a program used to spawn a program when needed. prosper was written for use under operating systems which don't support UNIX-style fork(2)s. prosper simply spawns a specified program and waits for the program to signal a semaphore. When the subprocess signals the semaphore, prosper spawns another copy of the program and waits for it to signal the semaphore. And so on and so on:

                                  PROSPER
                                  /  |  \
                             Sub#1 Sub#2 ...

When prosper spawns a program, it inserts a "-@ semaphore" option in the subprocess's argument list. semaphore is the integer ID of the semaphore that the subprocess should signal when it's time for prosper to spawn another copy of the program.

prosper was specifically written to run TPOCC server processes under VMS. Some TPOCC programs such as TSTOL and Reports execute as network servers. When a network connection request is received, the server process forks a subprocess to handle the new connection. Under UNIX, the new connection's socket can be passed from the server process to the child process. Not so under VMS! With prosper, the server process must act as both the server and the child process. Initially, the server opens a listening port socket and waits for a connection request. When a request is received, the server process closes its listening port socket, signals the prosper semaphore, and goes off to service the new connection. prosper, upon being signalled, starts up a new server process, which creates a listening port socket, waits for a connection request, etc., etc.

NOTE: Under VMS, the server process can't simply spawn a subprocess to become the new server. Doing so would result in a single-branching tree of server processes; if one subprocess went away, all subprocesses following it (below it in the tree) would go away, too!

Invocation:

% prosper [-debug] [-vperror] program argument(s)

where

-debug
enables debug output (written to stdout). This option must be specified before the program name argument (see below).
-vperror
turns vperror() message output on. This option must be specified before the program name argument (see below). vperror() messages are low-level error messages generated by libgpl functions; normally, they are disabled. If enabled, the messages are output to stderr.
program
is the name of the program which will be repeatedly spawned. Under VMS, this must be the pathname of the program (including the directory, etc.) or a foreign command which, when translated, gives the pathname of the program.
argument(s)
are the command line arguments the program is expecting.

Alex Measday  /  E-mail