> just to make sure I understand it right: > 1) An X10 program is only correct if all accesses to shared variables, > including all read accesses, are inside an atomic. >
It is correct as far as implementing the semantics of atomic -- it is perfectly possible to write a shared memory program without using atomic at all Also note that if you use when, the variables in the condition must be updated via atomic too. Otherwise the when will never be woken up again. when/atomic come as a pair. > 2) (Concluding from the samples), an exception to this rule is accesses > that > occur after finish, i.e., when there is only one activity left that may > access > the variable. > Variables can stop being shared if only one thread is accessing them. This is complicated by: 3) To achieve 2), it seems to me as that X10 does not have something like > the > temporary view of the OpenMP memory model, but all accesses go directly to > memory. > > I don't think we've discussed memory models yet. At the moment we are inheriting a memory model from c++/posix and Java (that may be subtly different). However in the long term we will probably have something that is the same for both backends and runs along the lines of defining a happens-before relation in terms of when/atomic/async/finish so that as long as you have some reasonable synchronisation then you'll get the values you expect. > Is this correct? Thanks, > > Claudia > > ------------------------------------------------------------------------------ > This SF Dev2Dev email is sponsored by: > > WikiLeaks The End of the Free Internet > http://p.sf.net/sfu/therealnews-com > _______________________________________________ > X10-users mailing list > X10-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/x10-users > ------------------------------------------------------------------------------ _______________________________________________ X10-users mailing list X10-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/x10-users