comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison <dennison@telepath.com>
Subject: Re: GNAT: storage error and tasks
Date: 2000/01/26
Date: 2000-01-26T00:00:00+00:00	[thread overview]
Message-ID: <86n1ae$bc8$1@nnrp1.deja.com> (raw)
In-Reply-To: 86mjv3$24b$1@nnrp1.deja.com

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.




  parent reply	other threads:[~2000-01-26  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-26  0:00 GNAT: storage error and tasks pjbrooke
2000-01-26  0:00 ` Aidan Skinner
2000-01-27  0:00   ` pjbrooke
2000-01-26  0:00 ` Ted Dennison [this message]
2000-02-05  0:00   ` Robert Dewar
replies disabled

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