comp.lang.ada
 help / color / mirror / Atom feed
From: "Warren W. Gay VE3WWG" <ve3wwg@cogeco.ca>
Subject: Re: Where are returned values stored?
Date: Wed, 02 Jun 2004 08:42:08 -0400
Date: 2004-06-02T08:42:08-04:00	[thread overview]
Message-ID: <AWjvc.22009$Hn.791710@news20.bellglobal.com> (raw)
In-Reply-To: <AN-dnWcaPPYezyDdRVn-gg@comcast.com>

Robert I. Eachus wrote:
> Warren W. Gay VE3WWG wrote:
>> A 2nd stack would mean fragmenting your memory space even
>> more, requiring a extra level of planning. Determining
>> stack requirements is always tricky when you have
>> subprograms that recurse. Otherwise static analysis would
>> be sufficient.
> 
> You are thinking like an embedded programmer, and probably should be 
> using SPARK.  

I would disagree, but this is unimportant ;-)

> In a virtual memory environment, things are much 
> different. I've lived in both worlds. If you make tasks "heavy" threads, 
> with their own virtual address space, the number of stacks and their 
> size is a non-issue.  

In a POSIX environment, this would be normally called a
"process" -- not a thread. But a quick perusal of
the word "thread" in technical dictionaries online,
seems to return an array of muddled definitions
for "thread".

Threads of course can be implemented with differing
levels of sharing, and one possibility is to not share the
stack address space.

Anyway, I tend to live in the POSIX world, and so for
me at least, more stacks means carving up more of the
precious 2GB address space on 32 bit platforms. Once
everyone moves to 64 bit processors, then this is less
of a problem.

> On compilers where tasks are lightweight (all 
> share a single address space) you can't be quite so free with addresses. 

This is precisely the scenario that I was concerned
about (worst case scenario).

>  But it usually suffices to materialize a minimum return stack if per 
> task if and when it is referenced, and leave it unallocated otherwise. 

Yes, of course.  You must still however, carve up the
address space for the stacks, whether the vm pages are
allocated or not.

 >...

otherwise, interesting comments.
-- 
Warren W. Gay VE3WWG
http://home.cogeco.ca/~ve3wwg




  reply	other threads:[~2004-06-02 12:42 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-26 19:46 Where are returned values stored? (follow up to yesterday's question) James Alan Farrell
2004-05-26 20:44 ` Simon Wright
2004-05-27  7:51   ` Dmitry A. Kazakov
2004-05-27  9:39 ` Where are returned values stored? Marius Amado Alves
2004-05-27 17:05   ` Warren W. Gay VE3WWG
2004-05-27 20:24     ` James Alan Farrell
2004-05-28 20:33       ` Warren W. Gay VE3WWG
2004-05-29  7:03         ` Martin Krischik
2004-05-29 13:19           ` Larry Kilgallen
2004-05-30  7:10             ` Martin Krischik
2004-06-02  3:14         ` Robert I. Eachus
2004-05-30 21:17     ` Nick Roberts
2004-05-31 12:58       ` Warren W. Gay VE3WWG
2004-06-02  4:07         ` Robert I. Eachus
2004-06-02 12:42           ` Warren W. Gay VE3WWG [this message]
2004-06-03  2:00             ` Nick Roberts
2004-06-03  4:34             ` Robert I. Eachus
2004-06-03 16:06               ` Warren W. Gay VE3WWG
2004-06-03 16:13               ` Nick Roberts
2004-06-07  1:53                 ` Robert I. Eachus
2004-06-07 13:09                   ` Larry Kilgallen
2004-06-09  7:03                     ` Robert I. Eachus
2004-06-05 17:13             ` Simon Wright
2004-05-27 17:11   ` Martin Krischik
2004-05-27 17:07 ` Where are returned values stored? (follow up to yesterday's question) Martin Krischik
replies disabled

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