Ada tasking on multi-core
July 17th, 2008 at 0:37 · Filed Under Ada
With a multi-core processor such as the Intel’s Core Duo, the Ada tasking can be easily demonstrated compared to single core Pentium processor. Consider the following Ada code:
with Ada.Text_IO; use Ada.Text_IO;
procedure Tasking is
task A;
task B;
task body A is
begin
for I in 1 .. 10 loop
Put_Line ("A");
end loop;
end A;
task body B is
begin
for I in 1 .. 10 loop
Put_Line ("B");
end loop;
end B;
begin
Put_Line ("Begin parallel tasking...");
Put_Line ("The end!");
end Tasking;
The above program produces the following result which easily reflects the parallel execution.
A
B
Begin parallel tasking...
A
B
The end!
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
Comments
4 Responses to “Ada tasking on multi-core”
Leave a Reply


Listen to my podcast
I have setup a 34 core system using 4 Mac Pro and 1 iMac running Xcode 3.1 and gnat 4.3. The tasking and partitioning are superb with Ada running on multi core.
I am developing safety critical hard real-time systems with distributed processing on multi core hardware.
Have you had any experience with Ravenscar profile in Ada 2005? How could distributed tasking and the object-oriented programming model be used together?
Thanks.
张薇
I am not all into Ada 2005 yet. In Ada 2005, Ravenscar profile is implemented with a compiler directive:
I don’t have any experience in Ravenscar profile at this moment.
As far as safety critical is concerned, object-oriented programming is not fit for safety critical use. When a mixture of tasking, distributed computing and object-oriented programming is concerned, the complexity exceeds many real world problems; but it doesn’t mean totally impossible.
You may consider an approach to programming distributed systems based on distributed objects. Distributed object model illustrates dynamic binding between partitions and remote subprogram calls via remote access-to-class-wide types.
The best person to consult is dragon as she has developed a 256 nodes quad core distributed system for her master.
Anthony Gargaro has published many papers on distributed object model.
Hope these help.
[...] wrote another post much earlier about Ada tasking on multi-core and received couple of comments yesterday. I have been [...]