-qthreaded

Pragma equivalent

None.

Purpose

Indicates to the compiler whether it must generate threadsafe code.

Always use this option when compiling or linking multithreaded applications. This option does not make code threadsafe, but it will ensure that code already threadsafe will remain so after compilation and linking. It also ensures that all optimizations are threadsafe.

Syntax

Read syntax diagramSkip visual syntax diagram
        .-nothreaded-.   
>>- -q--+-threaded---+-----------------------------------------><

Defaults

  • -qnothreaded for all invocation commands except those with the _r suffix
  • -qthreaded for all _r-suffixed invocation commands

Usage

This option applies to both compile and linker operations.

To maintain thread safety, a file compiled with the -qthreaded option, whether explicitly by option selection or implicitly by choice of _r compiler invocation mode, must also be linked with the -qthreaded option.

Predefined macros

None.

Related information



Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us