Dynamic Process naming/control


Subject: Dynamic Process naming/control
From: Kevin Cameron (Kevin.Cameron@nsc.com)
Date: Mon Apr 01 2002 - 11:41:07 PST


Dynamic process statements create a potentially semi-infinite array of processes which
may or may not persist.

Proposal:

The name from a dynamic process statement refers to an array of processes. Each
time the statement is called a process is added to (the end of) that array.

When a process terminates its name refers to a non-existant item until the array
the indexing wraps back to that index (which is at least a 32 bit). Allocation of
indices is not guaranteed to be contiguous or monotonic (for ease of implementation).

Extra functionality should be added to track the minimum and maximum indices
of the array and controlling the processes. E.g.:

  <process index> = $first(<process name>); // get first index
  <process index> = $last(<process name>); // get last index

  <process index> = $next(<process name>,<process index>);
                                                                 // get next (by creation order)

  <status> = $kill(<signal>,<process name>["["<process index>"]"]);
                                                                 // manipulate a process

'$kill' can be used to identify, stop, start and kill an individual process or all processes
in the array in a Unix-like manner:

  task foo;
     dyn_prcss: process ...;
     ...

  unsigned int pid = $first(foo.dyn_prcss);

  $kill(`SIG_STOP,foo.dyn_prcss[pid]); // put it to sleep

'$kill(0,...)' would return '0' (as per Unix) if the process exists, and a non-zero status
would indicate either it never existed, is dead, or the name is bad (index out-of range).
Used without a "[<process id>]" in the name it applies to all processes in the array.

Dynamic processes can spawn more processes, so a parent process will exist
as a "zombie" until its children are dead so that they are reachable by name.

An unamed dynamic process would be attached to its parent block, e.g. if the
dynamic process "dyn_prcss" in "foo" above was not named the process would
be reachable as "foo.process[<process id>]". That makes all processes acccessible
for control/debugging by name.

Feel free to offer alternative syntax/functionality.

Regards,
Kev.



This archive was generated by hypermail 2b28 : Mon Apr 01 2002 - 11:45:04 PST