Multithreaded program startup commands

To call a multithreaded Integrated Language Environment® (ILE) program, the job in which the program is called must be capable of supporting multiple threads (multithread-capable). Multithreaded Java™ programs can be called in most jobs (some system jobs restrict the types of programs that can be called).

In the IBM® i kernel threads support, only a subset of the supported job types can create threads. Interactive and communication jobs do not provide multithread-capable support.

The parameter Allow Multithread (ALWMLTTHD), which is located in the Create Job Description (CRTJOBD) and Change Job Description (CHGJOBD) commands, controls whether the job supports multiple threads. IBM i examines all job types except communications jobs and interactive jobs for the ALWMLTTHD parameter. The Add Prestart Job Entry (ADDPJE) and Change Prestart Job Entry (CHGPJE) subsystem description job entry commands use the ALWMLTTHD setting to control whether jobs started through the entry are capable of supporting multiple threads.

The spawn() API, Spawn Process, supports a flag field in the inheritance structure that controls whether the child process can support multiple threads. This flag field, SPAWN_SETTHREAD_NP, is a non-standard, IBM i platform-specific extension to the inheritance structure. The spawn() API is the only programming method that can start a batch immediate or prestart job that is capable of supporting multiple threads. You can write a SPAWN command, similar to the CALL command, to simplify calling multithreaded programs. An example SPAWN command is available for your use and modification as part of IBM i option 7, the IBM i Example Tools Library, QUSRTOOLS.