comp.lang.ada
 help / color / mirror / Atom feed
* How to set stack size of main task?
@ 1996-09-27  0:00 Volker.Lendecke
  1996-10-01  0:00 ` Stephen & Tammy House
  0 siblings, 1 reply; 7+ messages in thread
From: Volker.Lendecke @ 1996-09-27  0:00 UTC (permalink / raw)




Hello, all!

I have to write a numerical program with huge matrices, and my program
compiled by gnat segfaults beyond a certain matrix size. I read that with
pragma storage_size I can adjust the stack size of a specific task. But
where do I put this pragma to affect the main task, and what is the current
default value for gnat?

Please also answer direcly by mail, because my newsfeed is not too
reliable.

Thanks a lot,

Volker

-- 
   Volker Lendecke <lendecke@math.uni-goettingen.de>
    For my PGP public key, finger my email address.




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

* Re: How to set stack size of main task?
  1996-09-27  0:00 How to set stack size of main task? Volker.Lendecke
@ 1996-10-01  0:00 ` Stephen & Tammy House
  1996-10-02  0:00   ` Larry Kilgallen
  1996-10-02  0:00   ` David C. Hoos, Sr.
  0 siblings, 2 replies; 7+ messages in thread
From: Stephen & Tammy House @ 1996-10-01  0:00 UTC (permalink / raw)
  To: Volker.Lendecke


The main task stack size in Ada83 is determined by the RTS and or the
OS.  Under unix, the shell has stack size limits set (see the limit
command).  I'm not sure, but I doubt that Ada95 has done anything about
this.  Tasks are set up by the RTS, but there is no hook to the main
thread since it is started by the OS's loader.

Of course, you don't need to have to matrix allocated on the program
stack.  Create the object on the heap with an access type.  There still
might be problems with the compiler when objects get very large.  Check
around in package System for data record size limits.  And, of course,
even the heap has its limits, virtual memory or no.




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

* Re: How to set stack size of main task?
  1996-10-01  0:00 ` Stephen & Tammy House
@ 1996-10-02  0:00   ` Larry Kilgallen
  1996-10-05  0:00     ` Stanley Allen
  1996-10-02  0:00   ` David C. Hoos, Sr.
  1 sibling, 1 reply; 7+ messages in thread
From: Larry Kilgallen @ 1996-10-02  0:00 UTC (permalink / raw)



In article <3251CF5F.50B@ro.com>, Stephen & Tammy House <house@ro.com> writes:
> The main task stack size in Ada83 is determined by the RTS and or the
> OS.  Under unix, the shell has stack size limits set (see the limit
> command).  I'm not sure, but I doubt that Ada95 has done anything about
> this.  Tasks are set up by the RTS, but there is no hook to the main
> thread since it is started by the OS's loader.

On VMS, the main stack will "expand" when it runs out, although as
with any well-behaved operating system there are limits on how much
virtual memory can be spent in this endeavor (preventing an individual
user from filling the pagefile, for example).

I would hope that future Ada implementations running in memory-rich
environments (timesharing machines, not rocket ships) would support
an option to make other task stacks relatively unlimited as well.
64-bit addressing allows an individual OS process to have task
stack sizes of about 4 billion bytes, presuming the number of
tasks for a given program is limited to 4 billion as well :-).

Actually, my current need is less than 100 tasks, but I certainly
would rather get out of the business of specifying task sizes.

Larry Kilgallen




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

* Re: How to set stack size of main task?
  1996-10-01  0:00 ` Stephen & Tammy House
  1996-10-02  0:00   ` Larry Kilgallen
@ 1996-10-02  0:00   ` David C. Hoos, Sr.
  1 sibling, 0 replies; 7+ messages in thread
From: David C. Hoos, Sr. @ 1996-10-02  0:00 UTC (permalink / raw)



Stephen & Tammy House <house@ro.com> wrote in article
<3251CF5F.50B@ro.com>...
> The main task stack size in Ada83 is determined by the RTS and or the
> OS.  Under unix, the shell has stack size limits set (see the limit
> command).  I'm not sure, but I doubt that Ada95 has done anything about
> this.  Tasks are set up by the RTS, but there is no hook to the main
> thread since it is started by the OS's loader.
> 
> Of course, you don't need to have to matrix allocated on the program
> stack.  Create the object on the heap with an access type.  There still
> might be problems with the compiler when objects get very large.  Check
> around in package System for data record size limits.  And, of course,
> even the heap has its limits, virtual memory or no.
>
Please allow me to correct.  The main program stack in VADS, e.g., is set
by a
configurable parameter in the v_usr_conf_b.a package body source file. 
There are other
configurable parameters there, such as the default storage_size for tasks,
etc.  Other
toolsets provide similar things.
In gnat for WinNT, Windows95, it is controlled by the specs file in either
the gnu_ld
or the ms_lnk directories, depending on the linker you're using. 
-- 
David C. Hoos, Sr.,
http://www.dbhwww.com
http://www.ada95.com

 




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

* Re: How to set stack size of main task?
  1996-10-02  0:00   ` Larry Kilgallen
@ 1996-10-05  0:00     ` Stanley Allen
  1996-10-07  0:00       ` Larry Kilgallen
  1996-10-07  0:00       ` Larry Kilgallen
  0 siblings, 2 replies; 7+ messages in thread
From: Stanley Allen @ 1996-10-05  0:00 UTC (permalink / raw)



Larry Kilgallen wrote:
> 
> On VMS, the main stack will "expand" when it runs out, although as
> with any well-behaved operating system there are limits on how much
> virtual memory can be spent in this endeavor (preventing an individual
> user from filling the pagefile, for example).
> 
Have you checked this?  I made a simple recursive main program for
DEC Ada on VMS about 7 years ago (yes, I know that's ancient history),
which had no terminating condition -- infinitely recursive.  This
was a test of just this feature.

Apparently I did fill up the page file because the system crashed
for an hour or two.  I remember that I was working for {company X},
it was about 11:00am and the big VAX machine had about 80 users...
I don't think the system administrators ever knew it was my fault...
I kept my mouth shut... deleted the library....

Stanley Allen
sallen@ghgcorp.com




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

* Re: How to set stack size of main task?
  1996-10-05  0:00     ` Stanley Allen
  1996-10-07  0:00       ` Larry Kilgallen
@ 1996-10-07  0:00       ` Larry Kilgallen
  1 sibling, 0 replies; 7+ messages in thread
From: Larry Kilgallen @ 1996-10-07  0:00 UTC (permalink / raw)



In article <325608E8.C1B@ghgcorp.com>, Stanley Allen <sallen@ghgcorp.com> writes:
> Larry Kilgallen wrote:
>> 
>> On VMS, the main stack will "expand" when it runs out, although as
>> with any well-behaved operating system there are limits on how much
>> virtual memory can be spent in this endeavor (preventing an individual
>> user from filling the pagefile, for example).
>> 
> Have you checked this?  I made a simple recursive main program for
> DEC Ada on VMS about 7 years ago (yes, I know that's ancient history),
> which had no terminating condition -- infinitely recursive.  This
> was a test of just this feature.
> 
> Apparently I did fill up the page file because the system crashed
> for an hour or two.  I remember that I was working for {company X},
> it was about 11:00am and the big VAX machine had about 80 users...
> I don't think the system administrators ever knew it was my fault...
> I kept my mouth shut... deleted the library....
> 
> Stanley Allen
> sallen@ghgcorp.com




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

* Re: How to set stack size of main task?
  1996-10-05  0:00     ` Stanley Allen
@ 1996-10-07  0:00       ` Larry Kilgallen
  1996-10-07  0:00       ` Larry Kilgallen
  1 sibling, 0 replies; 7+ messages in thread
From: Larry Kilgallen @ 1996-10-07  0:00 UTC (permalink / raw)



In article <325608E8.C1B@ghgcorp.com>, Stanley Allen <sallen@ghgcorp.com> writes:
> Larry Kilgallen wrote:
>> 
>> On VMS, the main stack will "expand" when it runs out, although as
>> with any well-behaved operating system there are limits on how much
>> virtual memory can be spent in this endeavor (preventing an individual
>> user from filling the pagefile, for example).
>> 
> Have you checked this?  I made a simple recursive main program for
> DEC Ada on VMS about 7 years ago (yes, I know that's ancient history),
> which had no terminating condition -- infinitely recursive.  This
> was a test of just this feature.

I am sure there are limits, but the limits are set by your local
system administrators, and it is possible for them to allow you
more virtual memory than the pagefile can support.

> Apparently I did fill up the page file because the system crashed
> for an hour or two.  I remember that I was working for {company X},
> it was about 11:00am and the big VAX machine had about 80 users...

With that duration of outage, it was probably a "hang" rather than
a crash.  A "hang" is characterized by system administrators scratching
their heads while users wait.  A "crash" is characterized by system
administrators scratching their heads while users go on working since
the system has rebooted.

> I don't think the system administrators ever knew it was my fault...
> I kept my mouth shut... deleted the library....

There is plenty of evidence as to who was using all the pagefile
space, but a system administrator who did not have the quotas set
properly in the first place might not be skilled enough to read
the evidence.  A system administrator who _was_ skilled enough
to read the evidence would probably be too embarrassed about
having the quotas set wrong to discuss it with a mere user :-)

Bottom line, a well-designed, well-managed operating system
can insulate others from your infinite stack appetite and
serve you well for your merely outrageous stack appetite.
If either the well-designed or well-managed condition is not met,
you the individual have an opportunity to demonstrate it,
just as with the rocket discussions.

Larry Kilgallen




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

end of thread, other threads:[~1996-10-07  0:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-09-27  0:00 How to set stack size of main task? Volker.Lendecke
1996-10-01  0:00 ` Stephen & Tammy House
1996-10-02  0:00   ` Larry Kilgallen
1996-10-05  0:00     ` Stanley Allen
1996-10-07  0:00       ` Larry Kilgallen
1996-10-07  0:00       ` Larry Kilgallen
1996-10-02  0:00   ` David C. Hoos, Sr.

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