(Best to reply to the list, unless you really intend some questions to
be private. This way others with similar questions can use the mail logs
to get answers.)
On 5/12/14, 5:31 AM, Seisei wrote:
> Thank you Vijay!
>
> I tried the method workerId() in the class Runtime. Then, I found
> several activities made by async were ran per 1 worker.
> So, why did you make it public about worker, but private about activities?
>
What I said below. The language spec does not require that activities be
named at runtime, deliberately. For example, this supports the idea that
the compiler might actually eliminate an activity at compile-time,
merging it into a surrounding activity.
It is of course possible to design this differently, and distinguish,
for instance, between "potential runtime activities" and "actual runtime
activities". For now, it would make sense for you to implement what you
need to implement at the X10 source level, and see how this works out.
For instance, wherever u create an activity u could instead create an
instance of a new class you define, called Activity, and pass it the
code, e.g. instead of
async {
x.m();
y.inc();
}
you would call
new Activity(()=> { x.m(); y.inc();}).run();
and define Activity thus:
class Activity(f: ()=>void) {
public def run() {
async f();
}
}
Now you can add whatever code you want to add to Activity, e.g. add
whatever meta data you want as fields. Make the activity be a GlobalRef
so u can address it from any place.
Similarly you can "virtualize" Finish, through your own Finish class,
and keep track of meta-data of interest to you through your own Finish
class etc.
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users