[Patch, fortran] Document libgfortran thread-safety
Ralf Wildenhues
Ralf.Wildenhues@gmx.de
Sun Feb 6 21:45:00 GMT 2011
Hello Janne,
a few nits, if I may:
* Janne Blomqvist wrote on Sat, Feb 05, 2011 at 10:44:48PM CET:
> --- a/gcc/fortran/gfortran.texi
> +++ b/gcc/fortran/gfortran.texi
> @@ -1157,6 +1157,36 @@ representation of @code{LOGICAL} variables in GNU Fortran is identical
> to C99 _Bool, except for a possible difference in storage size
> depending on the kind.
>
> +
> +@node Thread-safety of the runtime library
> +@section Thread-safety of the runtime library
> +@cindex thread-safety, threads
> +
> +GNU Fortran can be used in programs with multiple threads, e.g. by
e.g.@: by
> +using OpenMP, by calling OS thread handling functions via the
> +@code{ISO_C_BINDING} facility, or by GNU Fortran compiled library code
> +being called from a multi-threaded program.
> +
> +The GNU Fortran runtime library, (@var{libgfortran}), supports being
@code{libgfortran} or @file{libgfortran}, I suppose.
@var is for metasyntactic variables.
> +called concurrently from multiple threads with the following
> +exceptions.
> +
> +During library initialization, the C @code{getenv()} function is used,
The GCS recommends to use refer to functions without trailing (), but I
see that the gfortran manual uses that elsewhere also. Several
instances.
> +which need not be thread-safe. Similarly, the @code{getenv()}
> +function is used to implement the @code{GET_ENVIRONMENT_VARIABLE} and
> +@code{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 @code{EXECUTE_COMMAND_LINE} and @code{SYSTEM} intrinsics are
> +implemented with the @code{system()} function, which need not be
> +thread-safe. It is the responsibility of the user to ensure that
> +@code{system()} is not called concurrently.
> +
> +Finally, for platforms not supporting thread-safe @code{POSIX}
POSIX without @code.
> +functions, further functionality might not be thread-safe. For
> +details, please consult the documentation for your operating system.
Cheers,
Ralf
More information about the Fortran
mailing list