comp.lang.ada
 help / color / mirror / Atom feed
* Tasking_Error
@ 2003-03-16 16:53 Stefan Soos
  2003-03-16 17:22 ` Tasking_Error James S. Rogers
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Stefan Soos @ 2003-03-16 16:53 UTC (permalink / raw)


Hallo all,

when i run the following program on Linux 2.4.18 with Gnat 3.14p-3 I
always get the following exception information:
Exception name: TASKING_ERROR
Message: Failure during activation

Here's the program:
--  Cut here  --
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Exceptions; use Ada.Exceptions;
procedure Task_Stressing is

   Maximum_Tasks : constant := 5000;

   task type Called_Task_Type is
      entry Start;
      entry Rendevouz;
   end Called_Task_Type;

   task body Called_Task_Type is
   begin
      accept Start;
      Put ("Tasks waiting so far: ");
      Put (Rendevouz'Count);
      New_Line;
      accept Rendevouz;
   end Called_Task_Type;

   Called_Task : Called_Task_Type;

   task type Calling_Task_Type is
      entry Start;
   end Calling_Task_Type;

   task body Calling_Task_Type is
   begin
      accept Start;
      Called_Task.Rendevouz;
   end Calling_Task_Type;

   type Calling_Task_Access is access Calling_Task_Type;

   type Calling_Task_List;
   type Calling_Task_List_Access is access all Calling_Task_List;
   type Calling_Task_List is
      record
         Next : Calling_Task_List_Access := null;
         Item : Calling_Task_Access := null;
      end record;
   Head : Calling_Task_List_Access;
   List_Items : Calling_Task_List_Access;
   Tasks_Created : Natural := 0;
begin
   Head := new Calling_Task_List;
   Head.Item := new Calling_Task_Type;
   List_Items := Head;
   Tasks_Created := Tasks_Created + 1;
   Create_Calling_Tasks :
   begin
      for I in 2 .. Maximum_Tasks  loop
         List_Items.Next := new Calling_Task_List;
         if (I mod 100) = 0 then
            Put (".");
         end if;
         List_Items.Next.Item := new Calling_Task_Type;
         List_Items := List_Items.Next;
         Tasks_Created := Tasks_Created + 1;
      end loop;
   exception
      when E : others =>
         New_Line;
         Put ("Tasks created: ");
         Put (Tasks_Created);
         New_Line;
         Put_Line (Exception_Information (E));
   end Create_Calling_Tasks;
   List_Items := Head;
   New_Line (2);
   STart_Calling_Tasks :
   for I in 1 .. Maximum_Tasks loop
      if List_Items.Item /= null then
         List_Items.Item.Start;
         if (I mod 100) = 0 then
            Put ("!");
         end if;
         List_Items := List_Items.Next;
      else
         exit Start_Calling_Tasks;
      end if;
   end loop Start_Calling_Tasks;
   New_Line (1);
   Called_Task.Start;
end Task_Stressing;
--  Cut here  --


Am I missing something or why is the program behaving faulty?
I don't know if it is of interest but my limit settings are:

core file size        (blocks, -c) 0
data seg size         (kbytes, -d) unlimited
file size             (blocks, -f) unlimited
max locked memory     (kbytes, -l) unlimited
max memory size       (kbytes, -m) unlimited
open files                    (-n) 1024
pipe size          (512 bytes, -p) 8
stack size            (kbytes, -s) unlimited
cpu time             (seconds, -t) unlimited
max user processes            (-u) 4095
virtual memory        (kbytes, -v) unlimited

Thanks for any ideas,
Stefan

-- 



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

end of thread, other threads:[~2003-03-17 21:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-16 16:53 Tasking_Error Stefan Soos
2003-03-16 17:22 ` Tasking_Error James S. Rogers
2003-03-16 17:48   ` Tasking_Error Stefan Soos
2003-03-17  7:30   ` Tasking_Error Pascal Obry
2003-03-17 21:43     ` Tasking_Error Anders Gidenstam
2003-03-17  8:03 ` Tasking_Error Egil Harald H�vik
2003-03-17 10:10 ` Tasking_Error Lutz Donnerhacke
2003-03-17 11:15   ` Tasking_Error Adrian Knoth

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