[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference azur::mcc

Title:DECmcc user notes file. Does not replace IPMT.
Notice:Use IPMT for problems. Newsletter location in note 6187
Moderator:TAEC::BEROUD
Created:Mon Aug 21 1989
Last Modified:Wed Jun 04 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:6497
Total number of notes:27359

3781.0. "Stack size questions" by TAEC::LAVILLAT () Tue Sep 22 1992 04:02

Hello,

I have some questions about thread stack size with MCC Ultrix V1.2

I know that the stack size for a MM can be controled via the <MM_NAME>_STACK
environment variable.

First set of question is : does this environment variable affect the stack size
of the Initial Thread (the thread that runs the INIT/LOG/PROBE routines for
example), and if not, what is the stack size of this thread, and is there a way
to modify it.

Second question : same using callable MCC : after the mcc_fw_init() call my
poor simple C program has become a thread : what is its stack size , and how
can I modify it ?

These questions are also related to the ILV problem described in note 3591.*

Thanks for your help.

Regards.

Pierre.
T.RTitleUserPersonal
Name
DateLines
3781.1stack on UltrixTOOK::KOHLSRuth KohlsTue Sep 29 1992 11:2459
<I have some questions about thread stack size with MCC Ultrix V1.2
<
<I know that the stack size for a MM can be controled via the <MM_NAME>_STACK
<environment variable.
<
<First set of question is : does this environment variable affect the stack size
<of the Initial Thread (the thread that runs the INIT/LOG/PROBE routines for
<example), and if not, what is the stack size of this thread, and is there a way
<to modify it.
<
In DECmcc on Ultrix, the inital thread's stack size is a CMA default, 
my source was unsure if it was 40 or 80 Kb.  If the environmental variable is 
present, its value is picked up at enrollment, and used from enrollment on.  
(the environmental must be set before enrollment to have an effect.)  
Each different MM the thread of execution enters adds its piece to the stack.  
This piece remains a part of the thread stack until the thread of execution 
exits the MM.

<Second question : same using callable MCC : after the mcc_fw_init() call my
<poor simple C program has become a thread : what is its stack size , and how
<can I modify it ?
<
<These questions are also related to the ILV problem described in note 3591.*
<
The C program is a thread from the moment it starts execution, but it is not
a DECmcc thread unless it is excuting inside the DECmcc environment. A program 
using callable MCC is not executing an MM, it is calling one or more routines.  
It must supply its own stack.  One way to do this is to create a child thread 
using the Callable DECmcc framework thread routines, but this certainly could 
be overkill.  

On Ultrix, the stack and data segment sizes of a program and the absolute 
limits on their growth are determined by the Ultrix kernel configuration.
The config values are contained in the config file in 
/sys/conf/mips/<SYSTEM NAME IN CAPS>.  Within the absolute limits, the stack 
and data segment sizes may be adjusted.  The Ultrix kernel must be 
reconfigured to adjust the absolute limits.

To adjust the limits before program execution for one process and all of its 
children, use the csh command "limit" ( see the Man pages on csh).  To adjust 
the limits and sizes after execution has started, use setrlimit (see 
getrlimit and  setrlimit in Man pages (2)).  However, this just adjusts 
the limits, it does not increase the available space.
Use sbrk to add to an area, brk to set the absolute address of the break.  
(syntax and more explanation in the Man pages, of course.) Even this only
works within the configured limits, and there is no way to tell if you've 
succeeded or failed.  However, if you've failed, the problem doesn't
go away.  

In the case in note 3591, if extending the stack didn't work, you couldn't 
tell if you'd hit the absolute limits (and the stack was not really extended),
if you'd done something else wrong, or were chasing down the wrong path. 
However, extending the stack with setrlimit worked in one case (3591.12).


I hope this helps.

Ruth K.
3781.2thanksTAEC::LAVILLATTue Sep 29 1992 12:458
>
>I hope this helps.
>
Yes !

Thanks.

Pierre.