From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,446940dda01a26f2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-16 09:22:16 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!wn12feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!not-for-mail Reply-To: "James S. Rogers" From: "James S. Rogers" Newsgroups: comp.lang.ada References: Subject: Re: Tasking_Error X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: Date: Sun, 16 Mar 2003 17:22:15 GMT NNTP-Posting-Host: 12.86.36.26 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1047835335 12.86.36.26 (Sun, 16 Mar 2003 17:22:15 GMT) NNTP-Posting-Date: Sun, 16 Mar 2003 17:22:15 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:35385 Date: 2003-03-16T17:22:15+00:00 List-Id: "Stefan Soos" wrote in message news:r6a25b.1bt.ln@ID-soos.user.dfncis.de... > 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 I believe that Linux implements tasks as user processes. You are trying to create 5000 tasks with a user process limit of 4095. The last 905 tasks you attempt to create will fail due to the process limit. Jim Rogers