Using the ATTACH macro

Figure 1 illustrates the concept of performing an OS ATTACH to a C, C++, nonmultitasking PL/I, or COBOL program, and thus establishing a separate Language Environment runtime environment. For each ATTACH to a Language Environment-conforming routine, another Language Environment runtime environment is added to the MVS™ address space. In COBOL, this is called multitasking; COBOL RES multitasking is supported only when all of the COBOL programs are compiled with Enterprise COBOL for z/OS, COBOL for OS/390 & VM, COBOL for MVS & VM, or COBOL/370 (not with OS/VS COBOL or VS COBOL II).

Figure 1. Issuing an ATTACH to Language Environment-conforming routines
A root HLL routine is created when subtasks in an HLL are attached to an assembler routine.

When running with POSIX(ON), use the POSIX function pthread_create in place of OS ATTACH to create a new thread.

Currently, each Language Environment environment supports one process. Within the process each enclave supports a single thread.

To make best use of the ATTACH macro, you need to be aware of: