Hello Vijay,

Thank you for your answer.

However, I have two more questions.
1)
 > For the duration of the X10 program, "idle" workers are constantly 
searching for work.
Does it mean that thread is polling to find a job?

2)
I found that the sequential Fibonacci program runs much slower with 24 
threads than with 1 thread. Following shows the results.
-INIT_THREADS=24, execution time of Fib(40) =108.35 sec
-INIT_THREADS=1, execution time of Fib(40) =8.16 sec
It means that the sequential program in X10 performs bad on multi-core 
platform. Is it related to the fork/join scheduler implementation?

Regards,
-Tetsu

On 07/12/2010 06:51 PM, Vijay Saraswat wrote:
> Added the following to the X10 Languages FAQ, 
> http://docs.codehaus.org/display/XTENLANG/X10+Language+Features+FAQ.
>
>
>         Why are all cores active when I run a sequential X10 program
>         on the Java backend?
>
> X10 implements async using a user-space scheduler (a ForkJoin 
> scheduler in v2.0.4). This scheduler starts with a given set of 
> workers (see How do I control the size of the thread pool in a place? 
> <http://docs.codehaus.org/display/XTENLANG/X10+Language+Features+FAQ#X10LanguageFeaturesFAQ-THREADSPOOLSIZE>).
>  
> For the duration of the X10 program, "idle" workers are constantly 
> searching for work. In the Java backend, the number default to 
> availableProcessors(), hence all cores are busy.
>
>
>         How do I control the size of the thread pool in a place?
>
> For the C++ backend, set the environment variable X10_NTHREADS to 
> control the number of initial workers in a place. For the Java 
> backend, provide the -INIT_THREADS command-line option. (This defaults 
> to availableProcessors().)
>
> Note that the ForkJoin scheduler in X10 2.0.4 may create more workers 
> if the current worker suspends (e.g. to execute a when).
>
> See X10 Runtime presentation at X10 Day 
> <http://docs.codehaus.org/download/attachments/140575067/X10_Runtime.pdf?version=2&modificationDate=1271426365763>
>  
> for more details.
>
>
> Tetsu Soh wrote:
>>     Hello everyone,
>>
>> I run a serial Fibonacci program(without multi-activity programming) on
>> a 24-core Linux box with Java back-end X10 2.0.4 and found that all
>> cores were active. How it comes? Is it because the thread pool that
>> employed in Java-back end is always working?
>> And is there any way to control how many threads should be active in the
>> thread pool in the case that I don't want all my cores are used to run
>> the X10 program?
>>
>> Thank you in advance.
>> -Tetsu
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by Sprint
>> What will you do first with EVO, the first 4G phone?
>> Visit sprint.com/first --http://p.sf.net/sfu/sprint-com-first
>> _______________________________________________
>> X10-users mailing list
>> X10-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/x10-users
>>
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to