5.3. Thread-safety of the runtime library

5.3 Thread-safety of the runtime library

GNU Fortran can be used in programs with multiple threads, e.g. by using OpenMP, by calling OS thread handling functions via the ISO_C_BINDING facility, or by GNU Fortran compiled library code being called from a multi-threaded program.

The GNU Fortran runtime library, (libgfortran), supports being called concurrently from multiple threads with the following exceptions.

During library initialization, the C getenv function is used, which need not be thread-safe. Similarly, the getenv function is used to implement the GET_ENVIRONMENT_VARIABLE and GETENV intrinsics. It is the responsibility of the user to ensure that the environment is not being updated concurrently when any of these actions are taking place.

The EXECUTE_CO