Sascha, It is always possible to save the state of an activity A this way to start running activity B but - you will not be able to resume A while B is running - you might run out of stack space.
So it only makes sense to run B on top of A's state if A is waiting for B to complete. In particular, if A and B periodically synchronize (e.g., using a clock) then doing this would lead to a deadlock. Olivier Sascha Roloff <sascha.rol...@googlemail.com> wrote on 08/23/2011 08:24:16 AM: > From: Sascha Roloff <sascha.rol...@googlemail.com> > To: Mailing list for users of the X10 programming language <x10- > us...@lists.sourceforge.net> > Date: 08/23/2011 08:27 AM > Subject: Re: [X10-users] X10 Runtime in X10 > > Hi Olivier, > > thank you for your response. This helped, I got the understanding of > the finish implementation. Now I come to my next question. As I can > see in the join method, the activity simply is saved, then other activities > are executed and then the initial activity is restored. Is it in general > possible > to save the state of an activity, change the execution to another activity > and > then restore the initial activity? > > Best regards, > Sascha > > , actually I wanted to know, > wheather > > 2011/8/22 Olivier Tardieu <tard...@us.ibm.com> > > > Hi Sascha, > > > > Your understanding of async is correct but finish is not implemented this > > way. > > The activity blocked on a finish is not pushed on the queue. > > The queues always contain activities that have not started yet, never > > suspended activity. > > > > When an activity blocks on a finish, it calls Runtime.worker().join. > > This methods executes asyncs in the worker queue until the finish gets > > unblocked. > > If there is no activity left but the finish is still blocked, for instance > > waiting on a remote activity, the runtime parks the thread until the > > finish is unblocked. > > > > I hope this helps. > > > > You may find a more extensive discussion of this mechanism in this paper > > (Section 5.2): > > > > http://dist.codehaus.org/x10/documentation/papers/X10Workshop2011/ > X10PerformanceModel.pdf > > > > Olivier > > > > Sascha Roloff <sascha.rol...@googlemail.com> wrote on 08/22/2011 12:08:31 > > PM: > > > > > From: Sascha Roloff <sascha.rol...@googlemail.com> > > > To: Mailing list for users of the X10 programming language <x10- > > > us...@lists.sourceforge.net> > > > Date: 08/22/2011 12:10 PM > > > Subject: [X10-users] X10 Runtime in X10 > > > > > > Dear list, > > > > > > I have a question regarding the implementation of the X10 runtime system > > > written in X10. > > > I guess, this is implemented in the class Runtime.x10. When I create an > > > activity with "async", > > > this activity is pushed onto the queue of a worker thread. Basically, > > this > > > is done in the method > > > call Runtime.execute(), right? The activities in the queue are executed > > one > > > after another, without > > > interrupting the activities. When I use a "finish" statement, then the > > > executing activity is suspended > > > until all internally created activities are finished. That means, that > > the > > > activity is dequed from the queue > > > and again enqueued at the end of the queue. My question now is, which > > method > > > call of the runtime does > > > this dequeing and enqueing of activities from and into the queue? I > > hope, my > > > question is understandable. > > > > > > Kind regards, > > > Sascha > > > > > > > > ------------------------------------------------------------------------------ > > > uberSVN's rich system and user administration capabilities and model > > > configuration take the hassle out of deploying and managing Subversion > > and > > > the tools developers use with it. Learn more about uberSVN and get a > > free > > > download at: http://p.sf.net/sfu/wandisco-dev2dev > > > _______________________________________________ > > > X10-users mailing list > > > X10-users@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/x10-users > > > > > ------------------------------------------------------------------------------ > > uberSVN's rich system and user administration capabilities and model > > configuration take the hassle out of deploying and managing Subversion and > > the tools developers use with it. Learn more about uberSVN and get a free > > download at: http://p.sf.net/sfu/wandisco-dev2dev > > _______________________________________________ > > X10-users mailing list > > X10-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/x10-users > > > ------------------------------------------------------------------------------ > Get a FREE DOWNLOAD! and learn more about uberSVN rich system, > user administration capabilities and model configuration. Take > the hassle out of deploying and managing Subversion and the > tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 > _______________________________________________ > X10-users mailing list > X10-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/x10-users ------------------------------------------------------------------------------ EMC VNX: the world's simplest storage, starting under $10K The only unified storage solution that offers unified management Up to 160% more powerful than alternatives and 25% more efficient. Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev _______________________________________________ X10-users mailing list X10-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/x10-users