User-Level Native Thread Primitives (GThread) Library White Paper (G06.27+, H06.03+, J06.03+)

User-Level Native Thread Primitives (GThread Library) 02/15/2012
540065-004 Page 23 of 44
Return: void *
The thread’s stack origin address.
Considerations:
Provided for completeness. Can be used for debugging or tracing purposes.
The origin is the address from which the stack grows. For TNS stacks, which grow toward higher
addresses, it is the same as the base of the stack. For TNS/R native stacks, which grow toward lower
addresses, it is at the high end of the stack area. For TNS/E native stacks, it is at the high end of the
memory-stack area.
GTH_STACK_USED_BASE_( GThread_CB cb )
Description:
Returns the lowest address of the allocated stack area currently in use by the specified thread. May
be called only for a static thread. This replaces accessing the thread control block element
StackStart.
Input:
cb - The address of the thread control block for the thread being checkpointed.
Return: void *
The base address of the used portion of the stack.
Considerations:
Provided for completeness. Can be used for debugging or tracing purposes.
The stack-used base is always the lowest address in use in the allocated stack area, regardless of the
platform architecture or the direction of stack growth or the number of stack components.
GTH_THREAD_NEXT_( GThread_CB cb )
Description:
Returns the next (younger) thread currently defined in the process. May be called for either static or
swapped threads. This replaces accessing the thread control block element ThreadNext.
Input:
cb - The address of the thread control block.
Return: GThread_CB
The address of the next thread.
Considerations:
Provided for completeness.
GTH_THREAD_PREV_( GThread_CB cb )
Description:
Returns the previous (older) thread currently defined in the process. May be called for either static or
swapped threads. This replaces accessing the thread control block element ThreadPrev.