2.6. Multithreading and standard Fortran I/O

Multithreading is the concurrent use of multiple threads of control that operate within the same address space. On UNICOS systems, multithreading is available through macrotasking, Autotasking, and the Pthread interface. On UNICOS/mk systems, multithreading is available through the Pthreads interface.

Standard Fortran I/O is thread-safe on UNICOS. Standard Fortran I/O is not thread-safe on UNICOS/mk systems.

On UNICOS systems, the runtime I/O library performs all the needed locking to permit multiple threads to concurrently execute Fortran I/O statements. The result is proper execution of all Fortran I/O statements and the sequential execution of I/O statements issued across multiple threads to files opened for sequential access.

On UNICOS/mk systems (where Fortran I/O is not thread-safe), threaded programs must use locks or other synchronization around Fortran I/O statements to prevent concurrent execution of I/O statements on multiple threads. Failure to do so causes unpredictable results.