Hi,
I'm getting a bit confused here: I have declared an array distributed across
several places. When I make a function that reads and modifies every element
of this array, the program builds and runs without throwing an exception.
Isn't this contradicting e.g. paragraph 2.3 in the Report where it's said
that:
"""
an activity may synchronously
access
data items only in the current place (the place in which the activity is
running).
It may atomically update one or more data items, but only in the current
place.
To read a remote location, an activity must spawn another activity
asynchronously
(ยง14.2).
"""
?
Or does this simply mean that spawning the activity and forcing futures
happens 'behind the scenes' ? I'm attaching my program below, perhaps I've
misunderstood some of the concepts. I'm using X10 1.7.
Thank you,
Ales
=== ===
class AsyncArr
{
val VECTLENGTH = 8;
val Reg:Region = 0..VECTLENGTH-1;
val Distr = dist.makeBlock(Reg);
public def run() : void
{
System.out.println(Distr);
val a = Array.make[int](Distr, (p(i) : Point) => i);
for (var i:int = 0; i < VECTLENGTH; i++)
{
a(i) = a(i)*2;
System.out.println(a(i));
}
}
public static def main(var args: Rail[String])
{
new AsyncArr().run();
}
}
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
X10-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/x10-users