comp.lang.ada
 help / color / mirror / Atom feed
* Task storage_size on task types with gnat
@ 1998-12-13  0:00 Pascal MALAISE
  1998-12-14  0:00 ` Tucker Taft
  0 siblings, 1 reply; 2+ messages in thread
From: Pascal MALAISE @ 1998-12-13  0:00 UTC (permalink / raw)


I have a task which needs a large (at least more than the deafult)
stack.
-- In fact, it dynamically instanciates a generic.

With gnat 3.10p (on linux) I cannot specify my task storage_size:

task STUFF is
...
end STUFF;
for STUFF'STORAGE_SIZE use 4*1024*1024;
--> storage size cannot be given for "STUFF"

But if I use a task type:
task type STUFF_T is
...
end STUFF_T;
for STUFF_T'STORAGE_SIZE use 4*1024*1024;
STUFF : STUFF_T;

It works OK.


Does anyone know - why the first approach is refused?
                 - a way to avoid a task type (I don't realy mind
though).
--
Pascal MALAISE
(priv) mailto:malaise@magic.fr
(prof) mailto:malaise@fr.airsysatm.thomson-csf.com




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

* Re: Task storage_size on task types with gnat
  1998-12-13  0:00 Task storage_size on task types with gnat Pascal MALAISE
@ 1998-12-14  0:00 ` Tucker Taft
  0 siblings, 0 replies; 2+ messages in thread
From: Tucker Taft @ 1998-12-14  0:00 UTC (permalink / raw)


Pascal MALAISE (malaise@magic.fr) wrote:

: I have a task which needs a large (at least more than the deafult)
: stack.
: -- In fact, it dynamically instanciates a generic.

: With gnat 3.10p (on linux) I cannot specify my task storage_size:

: task STUFF is
: ...
: end STUFF;
: for STUFF'STORAGE_SIZE use 4*1024*1024;
: --> storage size cannot be given for "STUFF"

In Ada 95, storage size for a task is specified by a pragma
rather than a rep clause, which goes *inside* the task spec:

   task Stuff is
      pragma Storage_Size(4*1024*1024);
      ...
   end Stuff;

In Ada 83, storage size was only specifiable for a task subtype,
via a rep clause.  In Ada 95, we switched over to a pragma
so that the Storage_Size could depend on the discriminants of the 
task, if any.

-Tucker Taft  stt@inmet.com

: But if I use a task type:
: task type STUFF_T is
: ...
: end STUFF_T;
: for STUFF_T'STORAGE_SIZE use 4*1024*1024;
: STUFF : STUFF_T;

: It works OK.


: Does anyone know - why the first approach is refused?
:                  - a way to avoid a task type (I don't realy mind
: though).
: --
: Pascal MALAISE
: (priv) mailto:malaise@magic.fr
: (prof) mailto:malaise@fr.airsysatm.thomson-csf.com

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA
An AverStar Company




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

end of thread, other threads:[~1998-12-14  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-13  0:00 Task storage_size on task types with gnat Pascal MALAISE
1998-12-14  0:00 ` Tucker Taft

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