From:   jpluto on

Has someone experience with Ada tasking (especially GNAT) on multi-core
systems?

Show programs with several working tasks a performance boost on dual-core or
quad-core cpus?

_________________________________________________________________
Find what you need at prices you�ll love. Compare products and save at MSN�
Shopping.
http://shopping.msn.com/default/shp/?ptnrid=37,ptnrdata=24102&tcode=T001MSN20A0701

From: Ludovic Brenta on
"Â jpluto" wrote:
> Has someone experience with Ada tasking (especially GNAT) on multi-core
> systems?
>
> Show programs with several working tasks a performance boost on dual-core or
> quad-core cpus?

On my dual-core Turion 64 with Debian GNU/Linux and GCC 4.1.2, all is
well. Ada programs using tasking use both cores. I think it would work
on most other platforms too, but YMMV.

--
Ludovic Brenta.

From: Dmitry A. Kazakov on
On 5 Mar 2007 02:08:22 -0800, Ludovic Brenta wrote:

> "� jpluto" wrote:
>> Has someone experience with Ada tasking (especially GNAT) on multi-core
>> systems?
>>
>> Show programs with several working tasks a performance boost on dual-core or
>> quad-core cpus?
>
> On my dual-core Turion 64 with Debian GNU/Linux and GCC 4.1.2, all is
> well. Ada programs using tasking use both cores. I think it would work
> on most other platforms too, but YMMV.

Apart from using both cores, does anybody know how protected objects
function on multi-cores? Especially:

1. Whether protected object's functions are indeed executed concurrently
when come from the tasks running on different cores?

2. What are the times required to take/release the protected object's spin
lock compared to ones on single core?

3. Can a task switch cores? If yes, what is the overhead of switching?

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
From: Jeffrey R. Carter on
jpluto wrote:
>
> Has someone experience with Ada tasking (especially GNAT) on multi-core
> systems?
>
> Show programs with several working tasks a performance boost on
> dual-core or quad-core cpus?

This has been discussed more than once. A search at groups.google.com
should find those for you.

GNAT certainly distributes tasks across multiple cores.

--
Jeff Carter
"If you think you got a nasty taunting this time,
you ain't heard nothing yet!"
Monty Python and the Holy Grail
23
From: tmoran on
> 1. Whether protected object's functions are indeed executed concurrently
> when come from the tasks running on different cores?

A quick test with a single protected object containing a single,
long-duration, function appears to have just one call of the function
active at a time, even if the function is called from two different tasks.

global_flag : integer := 0;

protected body pt is
function f(id : integer) return natural is
change_count : natural := 0;
begin
global_flag := id;
for i in 1 .. 10_000_000 loop
if global_flag /= id then
change_count := change_count;
global_flag := id;
end if;
end loop;
return change_count;
end f;
end pt;

One task calls pt.f(id=>1) and the other calls pt.f(id=>2). They both get
a result of zero back from their function call. This was with Gnat 3.15p
Windows 2000 on a dual core Pentium. If I change it from a single
protected object to two instances of a protected type, then the function
calls are overlapped and return non-zero results.

> 3. Can a task switch cores? If yes, what is the overhead of switching?
By "switch cores" do you mean that the particular hardware stack
pointers swap which stack they are pointing to? I think this is an OS
question and, for Windows, I don't know how one asks "which core am
I currently running on" - or indeed if that questions makes any sense.
 |  Next  |  Last
Pages: 1 2 3 4
Prev: #Ada IRC channel on Freenode
Next: Escape Codes