On 2/17/2011 8:41 AM, Aditya Sriram M wrote:
> I have a bunch of queries in understanding the X10 programming model. Could
> you please answer for me or redirect them to a right person if required.
> Thanks much.
>
>
>
> 1.    In X10, the doc speaks of activities (same as threads in Java) and
> atomicity (same as synchronized in Java) for synchronization. But if I
> wanted my threads to concurrently access the same shared object at the same
> time but using some mechanism on locks, wont it be possible in X10?
>
Yes, activities may concurrently access the same variable. Such 
activities should use atomic or when,
or lower level primitives such as x10.lang.Lock.
> 2.    Activity is a light weight Thread. Task is a light weight Activity.
> Is there something like a heavy weight Activity and/or Task then? Can you
> elaborate?

See http://x10.codehaus.org/FAQ; there are several related questions, 
and a pointer to the X10 Runtime presentation at X10 day.

The X10 programmer can specify the number of initial workers per place.

A worker is a thread in the runtime that executes asyncs. Typically a 
worker executes more than one async during its life-time. The X10 
programmer cannot control destruction of workers. The current X10 
runtime may create new workers on its own, under certain conditions.

The X10 programming model permits the programmer to write code that 
creates a large number of asyncs to be executed on a handful of 
workers.  Thus the X10 runtime takes on the task of efficiently mapping 
the asyncs to workers; this is the scheduling task. The current 
implementation uses a fork-join scheduler, a Cilk-style work-stealing 
scheduler is under development.

A programmer  may choose to create an async which executes a task for 
the duration of the X10 computation. This is similar to what a Java 
programmer would do in creating a java.lang.Thread and passing it a 
Runnable to execute for the lifetime of the thread. Thus in spirit a 
programmer can get the effect of a heavy-weight thread with a 
"heavyweight async".

That is, a programmer can write code in a "Java threads" style by 
creating only a handful of asyncs during the course of the computation.

> 3.    What is a worker activity as per X10? IS IT same as a simple activity,
> but that being spawned by a main rooted activity?
>
See above. There is no formal definition of "worker activity" other than 
a "worker". The word "activity" is sometimes used to mean the same thing 
as an "async".

>
> 4.    The notion of THREAD (both as a concept and keyword in X10) are
> completely removed??!
>
>
Correct. See above.
> Can you refer me to a more comprehensive/specific guide/reference for
> understanding activities? Is the Functional Spec available somewhere? BTW,
> is it shareable at all?
I see that you have found the language spec at 
http://dist.codehaus.org/x10/documentation/languagespec/x10-latest.pdf

There is also course material at the Princples and Practice of Parallel 
Programming course that Prof Kim and I taught at Columbia last Fall  at:

http://sites.google.com/site/coms4995pppp/home

You may find several tutorials at:

http://x10.codehaus.org/Tutorials

You may find Prof Christoph von Praun's site useful as well:

He has a very nice tutorial at:

http://www.in.ohm-hochschule.de/professors/praun/ws1011/x10tut/

Please also take a look at the Programmers' Guide being prepared by 
Jonathan Brezin:

http://dist.codehaus.org/x10/documentation/guide/pguide.pdf

Best,
Vijay




------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to