Threads considerations for C language

You must evaluate existing C applications for thread safety before calling them in a multithreaded job. If your C program is not threadsafe, techniques are available for calling programs that are not threadsafe from multithreaded jobs.

Not all C library functions are threadsafe. Before calling your existing C applications in a multithread-capable job, refer to the WebSphere® Development Studio: ILE C/C++ Programmer's Guide, SC09-2712 PDF Link to PDF and WebSphere Development Studio: C/C++ Language Reference, SC09-4815 PDFLink to PDF to determine whether all of your functions are threadsafe.

When using programs that are written in C, use the following actions:
  • Re-creation of Integrated Language Environment® (ILE) C applications:

    Compile and bind all existing ILE C applications with TGTRLS(*CURRENT) before you call them in a multithreaded job.

  • Elimination of *NEW activation groups:
    You should not use *NEW activation groups in multithreaded applications.
    Note: ACTGRP(*NEW) is the default on CRTPGM and CRTBNDC commands.
  • Calling ILE C *PGM objects:

    If you need to call an ILE C *PGM object that has an activation group of *NEW, either start another process to run the second program or create the second program specifying a named activation group.

Related reference
Calling functions that are not threadsafe