Indicates to the compiler that the program uses multiple threads. Always use this option when compiling or linking multi-threaded applications. This option ensures that all optimizations are thread-safe.


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


The default is -qthreaded when compiling with _r invocation modes, and -qnothreaded when compiling with other invocation modes.


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.

This option does not make code thread-safe, but it will ensure that code already thread-safe will remain so after compile and linking.

Related information