Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

2.3 AIX POSIX 1003.1c Thread Attribute Support

Threads.h++ may be configured to use the POSIX 1003.1c thread API under AIX 4.3.

2.3.1 Scheduling Attributes

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.

2.3.1.1 Start Policy

The start policy attribute is fully supported by the AIX implementation of Threads.h++ and defaults to RW_THR_START_RUNNING.

2.3.1.2 Contention Scope

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.

2.3.1.3 Scheduling Inheritance Policy

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.

2.3.1.4 Concurrency Policy

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.

2.3.1.5 Scheduling Policy

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.

2.3.1.6 Scheduling Priority

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.

2.3.1.7 Scheduling Time-Slice Quantum

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.

2.3.2 Stack Attributes

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.

2.3.2.1 System-Managed Stack Attributes

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.

2.3.2.2 User-Managed Stack Attributes

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.



Previous fileTop of DocumentContentsIndexNext file

©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.