z/OS Language Environment Concepts Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Threads

z/OS Language Environment Concepts Guide
SA38-0687-00

Each enclave consists of at least one thread, the basic instance of a particular routine. A thread is created during enclave initialization with its own runtime stack, which keeps track of the thread's execution, as well as a unique instruction counter, registers, and condition-handling mechanisms. Each thread represents an independent instance of a routine running under an enclave's resources.

Threads share all of the resources of an enclave. A thread can address all storage within an enclave. All threads are equal and independent of one another and are not related hierarchically. A thread can create a new enclave. Because threads operate with unique runtime stacks, they can run concurrently within an enclave and allocate and free their own storage. Because they may execute concurrently, threads can be used to implement parallel processing applications and event-driven applications.

Figure 1 illustrates the full Language Environment program model, with its multiple processes, enclaves, and threads.

As Figure 1 shows, each process is within its own address space. An enclave consists of one main routine, with any number of subroutines. A main routine might not be active at all times in a POSIX application, if the thread in which the main routine executes terminates before the other threads it created.

External data is available only within the enclave where it resides; notice that even though the external data may have identical names in different enclaves, the external data is unique to the enclave. The scope of external data is the enclave. The threads can create enclaves, which can create more threads, and so on.

Figure 1. Language Environment program management
In the program management model, each process is inside n its own address space. The threads can create enclaves, which can create more threads.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014