08-202 To: J3 From: Van Snyder Subject: Exclusive access mechanisms Date: 2008 May 31 References: 08-007r2, 08-020 1. Introduction The time will certainly arrive, and probably arrive soon, when Fortran will need additional constructs different from coarrays to deal with fine-grain parallelism. We already have two fine-grain constructs, namely DO CONCURRENT and FORALL. At the expense of some ugly circumlocution, i.e., by embedding a SELECT CASE construct in DO CONCURRENT, it can serve as a fork/join construct. It is not complete, however, in that atomic updates in one fork (i.e. one iteration) cannot be protected from another one, so complicated rules explain what happens in cases where such exclusive access would otherwise be desired. What is needed, and will eventually be provided, are fine-grain parallelism constructs, and a fine-grain equivalent to critical constructs and lock/unlock statements. To avoid inter-image synchronization delays, it will be desirable to separate exclusive access mechanisms for fine-grain parallelism from those for coarray parallelism. Therefore, when the need for fine-grain exclusive access control mechanisms is recognized, it will be necessary to distinguish them from coarray exclusive access control mechanisms. So that these new entities are not most obviously called NONCOCRITICAL, NONCOLOCK, NONCOUNLOCK, and NONCOLOCK_TYPE, it is useful now to name the current and currently-proposed entities using terms that reflect their coarray association. 2. Proposal a. Replace CRITICAL and END CRITICAL by COCRITICAL and END COCRITICAL, respectively. b. Replace , , , and by , , , and , respectively. c. Replace LOCK_TYPE in 08-020 by COLOCK_TYPE. d. Replace LOCK and UNLOCK in 08-020 by COLOCK and COUNLOCK, respectively. This isn't actually necessary if LOCK_TYPE is changed to COLOCK_TYPE because the type of the lock variable could determine the kind of lock (coarray as opposed to fine-grain). 3. Edits These edits are with respect to 08-007r2, and only for items 2a and 2b, since LOCK, UNLOCK and LOCK_TYPE are not yet in the draft. Items 2c and 2d would have to be changed in 08-020. [27: R212] ------------------------------------------------------------- Editor: Replace "" by "". [44: 3.3.2.2p3] -------------------------------------------------------- Editor: In the table, replace "CRITICAL" by "COCRITICAL". [146: 7.1.7p3] --------------------------------------------------------- Editor: Replace "CRITICAL" by "COCRITICAL" twice. [169: 8.1.1p1] --------------------------------------------------------- Editor: Replace "CRITICAL" by "COCRITICAL". [174: 8.1.6] ----------------------------------------------------------- Editor: Change the subclause heading to "COCRITICAL construct". [174-175: 8.1.6p1] ----------------------------------------------------- Editor: Replace "CRITICAL" by "COCRITICAL" thrice. Replace "<...critical...>" by "<...cocritical...>" 14 times. [175: 8.1.6p2] --------------------------------------------------------- Editor: Replace "CRITICAL" by "COCRITICAL". [175: 8.1.6p2 NOTE 8.9] ------------------------------------------------ Editor: Replace "CRITICAL" by "COCRITICAL" thrice. [175: 8.1.6p2 NOTE 8.10] ----------------------------------------------- Editor: Replace "CRITICAL" by "COCRITICAL" twice. [186: 8.2.1p1] --------------------------------------------------------- Editor: Replace "" by "" and replace "" by "". [187: 8.5.1p2] --------------------------------------------------------- Editor: Replace "CRITICAL" by "COCRITICAL" twice. [188: 8.5.1p3] --------------------------------------------------------- Editor: Replace "CRITICAL" by "COCRITICAL" twice.