|
Derivation: THREAD level STACK storage
THREADSTACK
controls the allocation of the thread's stack storage for both the
upward and downward-growing stacks, except the initial thread in a
multithreaded application.
If the thread attribute object
does not provide an explicit stack size, then the allocation values
can be inherited from the STACK option or specified explicitly on
the THREADSTACK option.
- Non-CICS default
- THREADSTACK=((OFF,4K,4K,ANYWHERE,KEEP,128K,128K),OVR)
- CICS® default
- THREADSTACK is ignored under CICS.
Syntax
.-OFF-.
>>-THREADSTACK--=--(--(--+-ON--+--,--usinit_size--,------------->
.-ANYWHERE-. .-KEEP-.
>--usincr_size--,--+-ANY------+--,--+-FREE-+--,--dsinit_size---->
'-BELOW----'
.-OVR----.
>--,--dsincr_size--)--,--+-NONOVR-+--)-------------------------><
- OFF
- Indicates that the allocation suboptions of the STACK runtime
option are used for thread stack allocation. Any other suboption specified
with THREADSTACK is ignored.
- ON
- Controls the stack allocation for each thread, except the initial
thread, in a multithread environment.
- usinit_size
- Determines the size of the initial upward-growing stack segment.
The storage is contiguous. You specify the usinit_size value
as n, nK, or nM
bytes of storage. The actual amount of allocated storage is rounded
up to the nearest multiple of 8 bytes.
usinit_size can
be preceded by a minus sign. In environments other than, if you specify
a negative number Language Environment uses
all available storage minus the amount specified for the initial stack
segment.
A size of "0" or "-0" requests half of the largest
block of contiguous storage in the region below the 16-MB line.
- usincr_size
- Determines the minimum size of any subsequent increment to the
upward-growing stack area. You can specify this value as n, nK,
or nM bytes of storage. The actual amount
of allocated storage is the larger of two values— usincr_size or
the requested size—rounded up to the nearest multiple of 8 bytes
If
you specify usincr_size as 0, only the amount
of the storage needed at the time of the request, rounded up to the
nearest multiple of 8 bytes, is obtained.
The requested
size is the amount of storage a routine needs for a stack frame.
For example, if the requested size is 9000 bytes, usincr_size is
specified as 8K, and the initial stack segment is full, Language Environment gets
a 9000 byte stack increment from the operating system to satisfy the
request. If the requested size is smaller than 8K, Language Environment gets
an 8K stack increment from the operating system.
- ANYWHERE | ANY | BELOW
- Specifies the storage location. For downward growing stack, this
option is ignored and the storage is always placed above 16MB.
- BELOW
- Specifies that the stack storage must be allocated below the 16MB
line in storage that is accessible to 24-bit addressing.
- ANYWHERE|ANY
- Specifies that stack storage can be allocated anywhere in storage.
If there is no storage available above the line, Language Environment acquires
storage below the 16-MB line.
- KEEP | FREE
- Determines the disposition of the storage increments when the
last stack frame in the increment segment is freed.
- KEEP
- Specifies that storage allocated to stack increments is not released
when the last of the storage in the stack increment is freed.
- FREE
- Specifies that storage allocated to stack increments is released
when the last of the storage in the stack is freed. The initial stack
segment is never released until the enclave terminates.
- dsinit_size
- Determines the size of the initial downward growing stack segment.
The storage is contiguous. You specify the init_size value
as n, nK, or nM
bytes of storage. The actual amount of allocated storage is rounded
up to the nearest multiple of 16 bytes.
- dsincr_size
- Determines the minimum size of any subsequent increment to the
downward growing stack area. You can specify this value as n, nK,
or nM bytes of storage. The actual amount
of allocated storage is the larger of two values-- incr_size or
the requested size--rounded up to the nearest multiple of 16 bytes.
- OVR
- Specifies that the option can be overridden.
- NONOVR
- Specifies that the option cannot be overridden.
Usage notes - The dsinit_size and dsincr_size values
are the amounts of storage that can be used for downward growing stack
frames (plus the stack header, approximately 20 bytes). The actual
size of the storage getmained will be 4K (8K if a 4K page alignment
cannot be guaranteed) larger to accommodate the guard area.
- The downward growing stack is only initialized in an XPLINK supported
environment, and only when an XPLINK application
is active in the enclave. Otherwise the suboptions for the downward
growing stack are ignored.
- The THREADSTACK option replaces the NONIPTSTACK and NONONIPTSTACK options.
- All storage allocated to THREADSTACK segments are freed when the
thread terminates.
- The initial stack segment of the thread is never released until
the thread terminates, regardless of the KEEP/FREE state.
- You can specify suboptions with THREADSTACK(OFF,...), but they
are ignored. If you override the THREADSTACK(OFF,...) suboption with
THREADSTACK(ON) and you omit suboptions, then the suboptions you specified
with THREADSTACK(OFF,...) remain in effect. If you respecify THREADSTACK(OFF,...)
with different suboptions, they override the defaults.
- In the multithreaded environment, you can explicitly specify the
stack size in the thread attribute object; it will be used instead
of the value specified with THREADSTACK or STACK.
- PL/I MTF considerations
- THREADSTACK(ON,4K,4K,BELOW,KEEP,,) provides PL/I compatibility
for stack storage allocation and management for each subtask in the
application.
- PL/I considerations
- For multitasking or multithreaded environments, the stack size
for a subtask or non-Initial Process Thread (non-IPT) is taken from
the THREADSTACK option unless THREADSTACK(OFF) is specified. THREADSTACK(OFF)
specifies that the values in the STACK option be used.
For more information - For more information about the STACK runtime option, see STACK.
- For more information about the ALL31 runtime option, see ALL31.
|