Programs and Processes

A program is a sequence of statements written in any of a number of languages, including ALGOL, C, COBOL74, COBOL85, FORTRAN77, Pascal, and Work Flow Language (WFL). The file in which you write and store these statements is referred to as a source file. By compiling the source file, you cause the creation of an object code file.

By using any of a number of commands or statements, you can cause a particular object code file to be initiated. That is to say, you cause the system to start performing the instructions in the object code file. At this point, the object code file is being executed. However, in a sense, nothing is happening to the object code file itself. The system merely reads instructions from the object code file; the contents of the file remain unchanged.

There is, nonetheless, a dynamic entity called a process, which is separate from the object code file, but which reflects the current state of the execution of the object code file. A process stores the current values of variables used by the program, as well as information about which procedures have been entered and which statement is currently being executed. (Procedures are discussed under Internal and External Processes later in this section.)

Each process exists in the system memory, and consists of several distinct structures that are discussed in Controlling Process Memory Usage.

The distinction between object code files and processes is a very important one. This is because, at any given time, there can be multiple processes that are executing the same object code file; these are referred to as instances of that object code file. A new instance is created each time a user or an existing process submits a statement that initiates the object code file.

Because many instances of the same object code file can be running at the same time, the object code file title is not sufficient to uniquely identify a process. Therefore, in system command displays, the various processes are identified both by an object code file title and by a unique number called the mix number. For further information on mix numbers, refer to Establishing Process Identity and Privileges.

Even if processes are executions of the same object code file, the processes are completely separate entities and do not interact with each other. For example, suppose the object code file called OBJECT/PROG includes a declaration of an integer variable named N, as well as various statements that assign values to N. In this case, each instance of OBJECT/PROG has its own copy of variable N in memory. When one process changes the value of N, there is no change to the value N has for the other processes.

The fact that processes are separate and maintain their own copies of variables generally prevents confusion and simplifies program design. However, there can also be cases where you want processes to have shared access to a particular variable. For these cases, the system provides a variety of interprocess communication techniques, which are described in Part II of this guide.

Tasking consists of using various features to initiate, monitor, and control processes. You can perform tasking functions by entering commands through various system operation interfaces, or by writing programs that initiate, monitor, and control the execution of other programs.