VMS Help
FORTRAN, Statements, Directive Statements, LOCKON and LOCKOFF

 *Conan The Librarian (sorry for the slow response - running on an old VAX)

  CPAR$ LOCKON lock-variable
  CPAR$ LOCKOFF lock-variable

  The LOCKON and LOCKOFF compiler directive statements can be used
  within a parallel DO loop to prevent multiple processes from
  executing selected statements in parallel.  These directives force
  the multiple processes executing a parallel DO loop to execute
  selected statements serially.  This can be useful when a statement
  (or set of statements) creates an unacceptable data dependence
  problem that cannot be resolved by other means.

  The lock variable can be a variable or a dummy argument.  It must
  have a data type of LOGICAL*4 and must have a status of shared
  (SHARED directive).  The lock is in effect when the lock variable
  has a value of .TRUE.  and unlocked when the lock variable has a
  value of .FALSE.

  The LOCKON and LOCKOFF directives perform the following operations:

    LOCKON     Waits, if necessary, for the lock variable to become
               .FALSE., then sets it to .TRUE. (that is, locks the
               lock), and then proceeds.
    LOCKOFF    Sets the lock variable to .FALSE. (that is, unlocks
               the lock).

  These directives use the VAX interlocked instructions to guarantee
  proper synchronization on a multiprocessor.  Do not use any other
  statements to modify the lock variable while another process may be
  executing a LOCKON or LOCKOFF directive.

  See your user manual for examples of how locks are used in parallel
  DO loops.
  Close     HLB-list     TLB-list     Help  

[legal] [privacy] [GNU] [policy] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.