Threads.h++ may be configured to use the POSIX 1003.1c thread API under AIX 4.3.
This section describes the AIX POSIX 1003.1c implementation-specific support, behavior, and restrictions for thread scheduling attributes.
The POSIX 1003.1c implementation under AIX 4.3 does not support priority scheduling of threads, so few of the scheduling attributes are available under this configuration.
The start policy attribute is fully supported by the AIX implementation of Threads.h++ and defaults to RW_THR_START_RUNNING.
In POSIX 1003.1c-compliant systems, support for contention scope is optional. Threads.h++ determines whether contention scope is supported by testing for the definition of the macro _POSIX_THREAD_PRIORITY_SCHEDULING.
The POSIX 1003.1c implementation provided under AIX 4.3 does not support priority scheduling and therefore does not support the concept of contention scope. Attempts to get or set this attribute value will result in exceptions.
Since the POSIX 1003.1c implementation provided under AIX 4.3 does not support priority scheduling, and therefore does not support the concept of scheduling inheritance. Attempts to get or set this attribute value will result in exceptions.
The concurrency policy attribute is not supported in the AIX implementation of Threads.h++. Attempts to get or set this attribute value will result in exceptions.
In POSIX 1003.1c-compliant systems, support for scheduling policy is optional. Threads.h++ determines whether scheduling policy is supported by testing for the definition of the macro _POSIX_THREAD_PRIORITY_SCHEDULING.
The POSIX 1003.1c implementation provided under AIX 4.3 does not support priority scheduling and therefore does not support the concept of scheduling policy. Attempts to get or set this attribute value will result in exceptions.
In POSIX 1003.1c-compliant systems, support for the specification of thread priority is optional. Threads.h++ determines whether scheduling priority is supported by testing for the definition of the macro _POSIX_THREAD_PRIORITY_SCHEDULING.
The POSIX 1003.1c implementation provided under AIX 4.3 does not support priority scheduling and therefore does not support the concept of scheduling priority. Attempts to get or set this attribute value will result in exceptions.
The time-slice quantum attribute is not supported in the AIX implementation of Threads.h++. Attempts to get or set this attribute value will result in exceptions.
In POSIX 1003.1c-compliant systems, support for user specification of stack attributes is optional. AIX supports size control for a system-managed stack, but does not support user-managed stacks.
POSIX 1003.1c-compliant systems provide optional support for controlling the reserve size of a system-managed stack, but provide no support for controlling the commitment of physical memory and page-file space to a thread stack.
Stack Reserve Size. In POSIX 1003.1c-compliant systems, support for user specification of stack reserve size is optional. Threads.h++ determines the support for stack reserve size by testing for the definition of the standard POSIX macro _POSIX_THREAD_ATTR_STACKSIZE. AIX does support the stack reserve size attribute for a system-managed stack.
Threads.h++ uses the POSIX macro, PTHREAD_STACK_MIN, to determine recommended minimum size for a thread stack. The API defines this value to be 8KB. This is the value that will be returned by the getMinStackSize() member.
If you query for the default stack reserve size, Threads.h++ uses the pthread_attr_getstacksize() function to retrieve the default stack size defined by an initialized pthread_attr_t instance. Under this API, the default stack size is 96KB.
To insure that each thread's stack size is always greater than the minimum allowable stack size, Threads.h++ adds the minimum stack size value to any size value retrieved from a thread attribute at the time a thread is created.
Threads.h++ imposes no upper limit for stack reserve size; the maximum stack size is effectively limited by available virtual memory space and page-file size. If the stack reserve size specified is too large for the available resources, an exception will be produced at the time a thread is created using the thread attribute instance with the offending reserve size value.
Stack Commit Size. The stack commit size attribute is not supported in the AIX implementation of Threads.h++. Attempts to get or set this attribute value will result in exceptions.
In POSIX 1003.1c compliant systems, support for user-defined stacks is optional. Threads.h++ determines the support for user-defined stacks by testing for the definition of the standard POSIX macro _POSIX_THREAD_ATTR_STACKADDR.
The AIX version 4.3 implementation of Threads.h++ supports user-managed stacks.
If an attempt is made to set the user stack address to zero, or to set the user stack size to a value less than the minimum stack size returned by the getMinStackSize() function, a RWTHRBoundsError exception is produced.
NOTE: Threads.h++ adjusts the address specified in setUserStack() to account for undocumented and possibly erroneous behavior in the AIX 4.3 POSIX API implementation. The underlying API apparently requires that 4KB of additional space before the beginning of the stack, otherwise the program will fail with a memory exception.
Threads.h++ adds 4096 to the address specified before passing it to the POSIX API. This means that the amount of storage to be allocated for the user stack should be increased by 4KB to account for this behavior. Be aware that getUserStackAddress() will return the adjusted address, not the original, so do not use the address returned by this function to free dynamically-allocated storage.
Threads.h++ imposes no upper limit for user stack size; the maximum stack size is effectively limited by the virtual memory space and pagefile size available to the user.
Attempts to query for a default user-stack address value or user-stack size value will result in an RWTHROperationNotAvailable exception. These values may only be queried after they have been set.
A call to setStackReserveSize() replaces or nullifies the attribute settings produced by any previous call to setUserStack() and vice versa.
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.