comp.lang.ada
 help / color / mirror / Atom feed
* task model
@ 2009-10-15 17:43 Mike
  2009-10-15 18:00 ` Ludovic Brenta
  0 siblings, 1 reply; 13+ messages in thread
From: Mike @ 2009-10-15 17:43 UTC (permalink / 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



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2009-10-19  7:56 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-15 17:43 task model Mike
2009-10-15 18:00 ` 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

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