Re: Does Ada tasking profit from multi-core cpus?



On Tue, 6 Mar 2007 19:58:31 -0800, Steve wrote:

"Dmitry A. Kazakov" <mailbox@xxxxxxxxxxxxxxxxx> wrote in message
news:rgcukvs1j6ck$.1vjj69zzy1h56$.dlg@xxxxxxxxxxxxx
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?

On Windows, which uses symmetric multiprocessing, I belive two cores works
the same as two CPU's. With two CPU's the two highest priority threads that
are in the ready state run concurrently, so yes a task can switch cores.
Sorry I don't know about the overhead of switching.
I have run tests on a system with 2 CPU's and found that a single task that
does a lot of switching winds up using 50% of the CPU time on both CPU's
(from the task viewer).

Just a side note, the Windows API GetThreadTimes (which the viewer
apparently uses) is corrupted. It counts complete time quants rather than
the performance counter ticks. So, potentially you could observe 1% under
factual 99% CPU load. The bug should appear for threads performing much
synchronization, because they leave the processor before the current quant
expiration.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
.



Relevant Pages