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=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,da126037e6b18fc5 X-Google-Attributes: gid103376,public From: Ted Dennison Subject: Re: GNAT: storage error and tasks Date: 2000/01/26 Message-ID: <86n1ae$bc8$1@nnrp1.deja.com>#1/1 X-Deja-AN: 577835908 References: <86mjv3$24b$1@nnrp1.deja.com> X-Http-Proxy: 1.0 x27.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Wed Jan 26 14:45:36 2000 GMT X-MyDeja-Info: XMYDJUIDtedennison Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.7 [en] (WinNT; I) Date: 2000-01-26T00:00:00+00:00 List-Id: In article <86mjv3$24b$1@nnrp1.deja.com>, pjbrooke@my-deja.com wrote: > I have a program that naturally decomposes into a procedure plus three > tasks. Each task contains some 'large' data structures. > > If I rewrite the program to use packages instead of tasks (this makes > other bits rather messy, so I'd rather use tasks) then there is no > problem. However, when using tasks, they raise Storage_Error. Nothing particularly "wrong". Its just that your tasks are probably running out of stack space. When they are created they each get their own stack, which is typically sized based on the compiler writer's guess as to how much most users will ever need. Your compiler docs should say somewhere what the default is. But its not at all uncommon for tasks that contain large data structures to blow past that default stack size. The way to get around this problem is to create a task type for your task, and perform a for My_Task_Type'Storage_Size use XXXXXX; Where "My_Task_Type" is the name of your task type and XXXXXX is the number of storage elements (bytes) you need your task to have. As for dertermining the value of XXXXXX, I generally just double it until the Storage_Error goes away, then double it again just to be safe. -- T.E.D. http://www.telepath.com/~dennison/Ted/TED.html Sent via Deja.com http://www.deja.com/ Before you buy.