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”

  1. Zhang Wei on August 8th, 2008 1:24

    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.

    张薇

  2. Adrian Hoe on August 8th, 2008 10:37

    I am not all into Ada 2005 yet. In Ada 2005, Ravenscar profile is implemented with a compiler directive:

    
       pragma Profile (Ravenscar);
    

    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.

  3. dragon on August 8th, 2008 10:44

    Anthony Gargaro has published many papers on distributed object model.

    • Towards Distributed Programming Paradigms in Ada 9X, ACM SIGAda/NASA Tenth Annual Washington Ada Symposium, ACM Press (1993).
    • Towards Distributed Objects in Ada 9X, Studies in Computer and Communications Systems - Volume 6, IOS Press (1993).
    • Towards Distributed Objects for Real-Time Systems, Seventh International Real-Time Ada Issues Workshop, IPPS’95 Conference, IEEE Press (1995).

    Hope these help.

  4. Pragmatic Revelations : Clear things up on August 9th, 2008 21:54

    [...] wrote another post much earlier about Ada tasking on multi-core and received couple of comments yesterday. I have been [...]

Leave a Reply