(j3.2006) (SC22WG5.3747) ATOMIC_DEFINE and SYNC MEMORY, WAS: Coarray summary

Aleksandar Donev donev1
Fri Dec 5 02:26:06 EST 2008

Hi John,

> Following the changes made in Tokyo, I have revised my summary and the 
> new version is attached. Comments will be welcome.
I took a quick look. It looks like Van and Bill caught most of the same 
things. Just to be sure, I list the things I spotted below.

But the reason I am cc'ing WG5 is the sentence after the example in the 
sync memory section, 11.5, which is presumably taken from Note 8.38. 
This note is updated in 08-297r1, but I think not sufficiently. In 
particular, it leaves both sync memory statements, before, and after the 
call to ATOMIC_DEFINE. Van was asking about this earlier. I believe the 
second sync memory is now superfluous. Surely the completion of 
execution of ATOMIC_DEFINE indicates that the value is written where it 
is supposed to be. So I don't see how the statement "The second 
sync_memory statement encourages the compiler to release the lock at 
once..." is correct now. Note 8.38 should not say such things 
either--Bill, if you agree, please add this to the missing "scalar" 
requirement for VALUE when you write a paper.

Question: Do ATOMIC_INT_KIND and ATOMIC_LOGICAL_KIND have to be 
positive, i.e., does the processor have to support atomic operations for 
at least one kind? I think so, but the wording in 08-297r1 is confusing 
to me. Your summary should state one way or another, whichever is correct.

These refer to the original version you sent me and Bill:
-The top of page 14 needs updating as indicated by Van (it is even more 
complex now :-()
-last para of 11.2 needs to go away (no mmore volatiles)
-bottom of page 17 needs to be changed (user-defined ordering)
-penultimate para of section 11.5 needs to go away, except for maybe the 
first sentence. the example in 11.5 has some problems Bill saw (also see 
above). you should also mark in it where the segments P_i and W_j you 
mention are.
-the last para of section 11.5 is wrong---without volatile you cannot 
use sync memory to write your own syncs. with the atomics, perhaps. i 
would delete the para.


More information about the J3 mailing list