Guardian Programmer's Guide

Table Of Contents
Creating and Managing Processes
Guardian Programmer’s Guide 421922-014
16 - 19
Creating Processes
The runnable state is of most interest. Only processes that are in the runnable state
are capable of using the CPU. Figure 16-6 shows the possible substates of a runnable
process.
The CPU is composed of one or more IPUs, each of which can execute a process.
Associated with each IPU is a list of READY processes to be run on that IPU which is
called a ready list. The process scheduler rearranges those lists occasionally for load-
balancing and responsiveness purposes.
An active process is a process which is currently using an IPU. On a CPU with 4 IPUs
there are four active processes. The process chosen to be the active process is the
one with the highest priority on the given IPU's ready list.
The active process goes into the waiting state when it can no longer use the CPU, for
example when waiting for an external event to complete such as an I/O operation. An
active process goes into the ready state if it is preempted by a higher priority ready
process.
Waiting processes that have satisfied their wait conditions go into the r
eady state.
The highest priority ready process in an IPU goes into the ac
tive state when
1) The active process on the IPU goes into the waiting state, or
2) The active process is of lower priority than the highest priority process in the
given IPU's ready list.
Creating Processes
To programmatically create a Guardian process, you call the PROCESS_LAUNCH_ or
PROCESS_CREATE_ procedure and pass it the name of the program file containing
the program you want to execute. You can optionally supply a user library file
providing additional procedures. The PROCESS_LAUNCH_ and
PROCESS_CREATE_ procedures return a process handle that you can use to identify
the created process in subsequent procedure calls.
Figure 16-6. Runnable Processes
VST085.VSD