comp.lang.ada
 help / color / mirror / Atom feed
From: Mike <michael_tabak@yahoo.com>
Subject: task model
Date: Thu, 15 Oct 2009 10:43:32 -0700 (PDT)
Date: 2009-10-15T10:43:32-07:00	[thread overview]
Message-ID: <04458a0b-1e58-478b-a2f0-c47226f840ac@f16g2000yqm.googlegroups.com> (raw)

I'm prototyping some tasking with multiple accepts, the code is as
follows:

with Ada.Text_Io;
use Ada.Text_Io;

procedure task_test is


   procedure Process_Primary(node: in Integer) is

   begin

       Put_Line("This is number" & Integer'Image(node));

   end Process_Primary;


   task proc1 is
     entry process1(node : Integer);
     entry continue;
   end proc1;

   task body proc1 is
   begin

     accept process1( node : Integer) do

       Process_Primary( node );

     end;

     accept continue do
       Put_Line("Called Continue task1");
     end;

   end proc1;

   task proc2 is
     entry process2(node : Integer);
     entry continue;
   end proc2;

   task body proc2 is
   begin

     accept process2( node : Integer) do

         Process_Primary( node );

     end;

     accept continue do
       Put_Line("Called Continue task2");
     end;

   end proc2;


begin
  for i in 1..2 loop
   proc1.process1(1);
   proc2.process2(2);
   proc1.continue;
   proc2.continue;
  end loop;
end task_test;
---------------------------------------------------------------------------------------------------------------------

I get the out put I expect:

This is number 1
This is number 2
Called Continue task1
Called Continue task2


But I also get the following error which I can't track down:

raised TASKING_ERROR : s-tasren.adb:486

I'm running on a Xeon blade with gnat under linux

Thanks
Mike



             reply	other threads:[~2009-10-15 17:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-15 17:43 Mike [this message]
2009-10-15 18:00 ` task model Ludovic Brenta
2009-10-15 19:15   ` Anh Vo
2009-10-15 19:54     ` Dmitry A. Kazakov
2009-10-15 20:15       ` Jeffrey R. Carter
2009-10-16 14:06       ` Georg Bauhaus
2009-10-16 14:57         ` Brad Moore
2009-10-16 20:06         ` Jeffrey R. Carter
2009-10-17 11:10           ` Georg Bauhaus
2009-10-17 12:18             ` Dmitry A. Kazakov
2009-10-17 17:34             ` Jeffrey R. Carter
2009-10-19  7:56         ` Jean-Pierre Rosen
2009-10-15 19:55     ` sjw
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox