ILE COBOL Programmer's Guide
In the iSeries environment, programs may run within the threads
of processes. ILE COBOL supports multithreaded execution by means of
the THREAD PROCESS statement option (see THREAD Option). In order to understand this chapter's
discussion of ILE COBOL support for multithreading, you need to be familiar
with the following terms:
- Job
- On the iSeries system, a job represents a process. The operating
system and multithreading applications can handle execution flow within a
job. Multiple jobs can run concurrently, and programs running within a
job can share resources. A job is the container for the memory and
resources of the program.
- Thread
- Within a job, an application can initiate one or more threads.
Within a thread, control is transferred between executing programs.
- Run-unit
- On the iSeries system, a run-unit represents the program activation
group. A run unit can contain muliple threads. When a COBOL
run-unit ends in a multithreaded environment, the job also ends. Within
a run-unit, ILE COBOL programs can call non-ILE COBOL programs, and vice
versa.
- Program Invocation Instance
- Within a thread, control is transferred between separate ILE COBOL and
non-ILE COBOL programs. For example, an ILE COBOL program can CALL
another ILE COBOL program or an ILE C program. Each separately invoked
(as in, CALLed) program is a program invocation instance. Program
invocation instances of a particular program might exist in multiple threads
within a given job.
The following illustration shows the relationships between jobs, threads,
run-units, and program invocation instances:
Figure 86. Schematic Illustration of Multithreading Concepts

ILE COBOL does not have a COBOL statement to support initiating or managing
program threads, but COBOL programs can use APIs to do this. ILE COBOL
programs can run in threads in a multithreaded environment. In other
words, ILE COBOL programs can be invoked by other applications such that they
are running in multiple threads within a job or as multiple program invocation
instances within a thread.
The remainder of this chapter contains information that will help you
prepare your ILE COBOL programs for multithreaded environments.
This chapter describes:
- How Language Elements Are Interpreted in a Multithreaded Environment
- When to Choose THREAD for Multithreading Support
- Control Transfer within a Multithreaded Environment
- An Example of Using ILE COBOL in a Multithreaded Environment.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.