Hi, That is different from what I understood.
In fact, there is only one line in the language specification about nested clocked finishes: "Clocked finishes may be nested. The inner clocked finish operates in a single phase of the outer one." and your description of Clock.advanceAll() is colliding with this line. Personally, I see little utility for nested clocked finishes if inner scopes are still tied to outer clocks. Regards, Tomofumi Yuki ----- Original Message ----- > From: "David P Grove" <gro...@us.ibm.com> > To: "Mailing list for users of the X10 programming language" > <x10-users@lists.sourceforge.net> > Sent: Thursday, December 4, 2014 4:11:28 PM > Subject: Re: [X10-users] Nested Implicit Clock Behavior > > > Hi, > > I think there is a misunderstanding about what Clock.advanceAll() > does in the presence of nested clocked finishes. Namely, it advances all > clocks of the activity (both inner and outer). This points to perhaps a > mistake made in the specification when we replaced the next keyword with > Clock.advanceAll() (I will take a look). In the case of nested clocks, we > should have used Clock.advance(). > > To illustrate, I added print statements to the more complex program, > run on Native X10, and I see output that is consistent with this > interpretation of Clock.advanceAll: > > [dgrove@linchen myTests]$ x10c++ Test1.x10 > [dgrove@linchen myTests]$ ./a.out > Outer, tick 0 x=-1 > Inner 2, tick 0 x=-1 > Inner 1, tick 0 x=-1 > Outer, tick 1 x=-1 > Outer, tick 1 after assign x=3 > Inner 2, tick 1 x=3 > Inner 1, tick 1 x=3 > Inner 1, tick 2 x=3 > Inner 1, tick 2 after assign x=1 > Inner 2, tick 2 x=3 > Inner 2, tick 3 x=1 > Inner 2, tick 3 after assign x=0 > x=0 > > The programs is appended. > > --dave > > class Test1 { > public static def main(Rail[String]) { > var x: Long = -1; > > clocked finish { > clocked async { > clocked finish { > Console.OUT.println("Inner 1, tick 0 x="+x); > Clock.advanceAll(); > Console.OUT.println("Inner 1, tick 1 x="+x); > Clock.advanceAll(); > Console.OUT.println("Inner 1, tick 2 x="+x); > x= 1; > Console.OUT.println("Inner 1, tick 2 after assign x="+x); > } > } > clocked async { > clocked finish { > Console.OUT.println("Inner 2, tick 0 x="+x); > Clock.advanceAll(); > Console.OUT.println("Inner 2, tick 1 x="+x); > Clock.advanceAll(); > Console.OUT.println("Inner 2, tick 2 x="+x); > Clock.advanceAll(); > Console.OUT.println("Inner 2, tick 3 x="+x); > x= 0; > Console.OUT.println("Inner 2, tick 3 after assign x="+x); > } > } > Console.OUT.println("Outer, tick 0 x="+x); > Clock.advanceAll(); > Console.OUT.println("Outer, tick 1 x="+x); > x = 3; > Console.OUT.println("Outer, tick 1 after assign x="+x); > } > > Console.OUT.println("x="+x); > } > } > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk > _______________________________________________ > X10-users mailing list > X10-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/x10-users > ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk _______________________________________________ X10-users mailing list X10-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/x10-users