Reputation: 3136
In pursuing A3C I need to set multiple global and local parameters. The global parameters need to have shared size. I think this means atomic
variables, but it's still new to me.
var n: atomic int,
x: [1..n] real; # a vector of global size
proc localDude(){
n +=1; # increase the size of n
}
I understand the array will grow and shrink with the domain
, but I'm having a hard time getting the semantics together. Thanks!
Upvotes: 2
Views: 182
Reputation: 502
So there are a few things.
sync
variable as a lock so that modifications are serialized. There is an example of this on the learn Chapel in Y minutes tutorial, near the bottom (search for mutex)Upvotes: 3