aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/gfortran.texi
diff options
context:
space:
mode:
authorJanne Blomqvist <jb@gcc.gnu.org>2011-02-06 18:08:03 +0200
committerJanne Blomqvist <jb@gcc.gnu.org>2011-02-06 18:08:03 +0200
commit6985b4a110323bea66ca938532a63a4f936a422f (patch)
treebcf6b8b357c7c4f19c680c71c737e761328e04b1 /gcc/fortran/gfortran.texi
parentb1b0c7e63d236511d08212882d142018253962cf (diff)
downloadgcc-6985b4a110323bea66ca938532a63a4f936a422f.zip
gcc-6985b4a110323bea66ca938532a63a4f936a422f.tar.gz
gcc-6985b4a110323bea66ca938532a63a4f936a422f.tar.bz2
Document libgfortran thread-safety
From-SVN: r169864
Diffstat (limited to 'gcc/fortran/gfortran.texi')
-rw-r--r--gcc/fortran/gfortran.texi30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index a34d82e..54f2457 100644
--- 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
+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
+called concurrently from multiple threads with the following
+exceptions.
+
+During library initialization, the C @code{getenv()} function is used,
+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}
+functions, further functionality might not be thread-safe. For
+details, please consult the documentation for your operating system.
+
@c ---------------------------------------------------------------------
@c Extensions
@c ---------------------------------------------------------------------