Here is the only one I have been able to come up with that doesn't
give me a compiler error or a Clock use exception. However, it
doesn't give the desired result (which you can probably see from the
code)
clocked finish for([p] in 0..Place.MAX_PLACES -1 )
{
clocked async at (Place.place(p))
{
finish for([threadId] in 0..nThreads-1)
{
async
{
Console.OUT.println(here.id()+1);
next;
Console.OUT.println((here.id()+1) * 10);
next;
}
}
}
}
For 4 places, 2 threads per place, I would like to see:
some permutation of:
1
1
2
2
3
3
4
4
then some permutation of:
10
10
20
20
30
30
40
40
Any verified code that can do this? I've tried named clocks (clock
use exception or deadlock) nested implicit clocks (compiler error).
Any help would be greatly appreciated.
Thanks very much,
John
You need to have the innermost async be clocked, so the async is actually clocked on some clock.
class C {
public static def main(Array[String]) {
clocked finish for([p] in 0..Place.MAX_PLACES -1 )
{
clocked async at (Place.place(p))
{
for([threadId] in 0..2-1)
{
clocked async
john