(j3.2006) C501 in TS 18508
Van Snyder
Van.Snyder
Mon Mar 4 16:42:21 EST 2013
On Mon, 2013-03-04 at 15:00 -0600, Bill Long wrote:
> > It would be better (i.e., easier to find) if these were constraints on
> > the EXIT and CYCLE statements, not on the change-team construct. I.e.,
> > part of C821 and C845 in 12-007.
>
> CYCLE is a straightforward edit to C821. EXIT is a a bit different. It
> is desirable to allow an EXIT statement that belongs to the CHANGE TEAM
> construct, but you want the effect to be a branch to the END TEAM
> statement. At that point, it hits the barrier there; completion of the
> construct occurs later when the other images have checked in. (The
> alternative is to disallow EXIT and require the user to put a statement
> number on the END TEAM statement and use a GOTO statement to jump to
> the end of the construct.)
This could be done within C845 with something like ", or within a CHANGE
TEAM construct if it belongs to an outer construct." Alternatively, a
separate constraint, say C845a, could do it.
Is there a problem with EXIT belonging to a CRITICAL construct?
Wouldn't this also effectively be a branch to the END CRITICAL
statement? Maybe C845 ought to be
C845 An <exit-stmt> shall not appear within a DO CONCURRENT construct if
it belongs to that construct or an outer construct, or within a
CRITICAL or CHANGE TEAM construct if it belongs to an outer
construct.
Simpler would be
C845 An <exit-stmt> within a DO CONCURRENT construct shall not belong
to that construct or an outer construct; an <exit-stmt> within a
CRITICAL or CHANGE TEAM construct shall not belong to an outer
construct.
Although it is probably stylistically better not to terminate these
constructs other than by executing their END construct statements
(perhaps by way of an EXIT statement), it isn't strictly necessary for
correct behavior. The end-of-construct actions, such as synchronization
at the END TEAM statement, or lifting the entry barrier at the END
CRITICAL statement, could be specified in terms of terminating execution
of the block of the construct (8.1.2.2p2) (probably should be in any
case). The compiler would need to do the end-of-construct actions at
all the terminations. This could be implemented with just one copy of
the code at the END construct statement, followed by an assigned GO TO
to the real continuation ;->
More information about the J3
mailing list