User-Level Native Thread Primitives (GThread) Library White Paper (G06.26+)

User-Level Native Thread Primitives (GThread Library) 03/31/2005
Hewlett-Packard Company--540065-001 Page 6 of 46
interface or continuing to use the original interfaces. Existing TNS clients using the GThread library on
TNS/E can avoid recompilation if they choose.
For TNS/E platforms, the following additions were made to existing interfaces:
1) A set of routines that replace directly accessing the thread control block. These routines
abstract the knowledge of the TNS/E stack architecture such that the client can see one virtual
‘stack’ per thread.
2) A routine that returns an estimated stack size based on the client’s stack size allocation on
TNS/R. The results of this optional routine are used for stack allocation and thread creation.
3) New routines to assist in the stack saving process for swapped stack threads.
4) A define and further enhancement of the GTHREAD_INITIATE_ call that permits clients to
control stack allocations on TNS/E platforms.
The following new calls support these changes:
GTH_ALLOCATED_SIZE_ GTH_STACK_CHECK_ACTIVE_
GTH_ALLOCATED_BASE_ GTH_STACK_CHECK_THREAD_
GTH_STACK_USED_ GTH_STACK_CHECK_ACTIVE2_
GTH_STACK_SAVE_ GTH_STACK_CHECK_THREAD2_
GTH_STACK_RESTORE_ GTH_STACK_USED_BASE_
GTH_SET_ALLOCATION_ GTH_THREAD_NEXT_
GTH_STACK_ORIGIN_ GTH_THREAD_PREV_
GTH_GET_ESTIMATED_STACK_SIZE_