ILE COBOL Programmer's Guide

Creating and Running the Multithreading Example

To create and run the multithreading example, follow these steps:

  1. Create three ILE COBOL modules
  2. Create a program THREAD using the three modules
  3. Create a SPAWN command to call the multithreaded program THREAD
    SPAWN MYLIB/THREAD DEBUG(2)
    

    For information on how to create a SPAWN command, refer to the Multithreaded Applications document, listed under the Programming topic, at the following URL: http://www.ibm.com/eserver/iseries/infocenter

  4. To display the output of the program, type DSPMSG QSYSOPR. The output depends on which thread runs first and will show the sequence of the threads as:
    IN SUBB
    IN SUBA
    

    or as,

    IN SUBA
    IN SUBB
    


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]