Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

6.4 OSF/1 POSIX 1003.1c V1 Thread Attribute Support

6.4.1 Scheduling Attributes

The following sections describe the specific support, behavior, and restrictions for thread scheduling attributes under OSF/1 version 4.0 and the POSIX 1003.1c V1 API.

6.4.1.1 Start Policy

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

6.4.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. Even if the API indicates that priority scheduling is supported, the environment may only allow one policy.

The OSF/1 version 4.0d implementation of POSIX 1003.1c supports both process and system scope threads. Threads.h++ maps its RWContentionScope values to the underlying POSIX 1003.1cAPI as follows:

Table 15 -- OSF/1: Mapping of RWContentionScope to POSIX 1003.1c V1 values

Threads.h++
RWContentionScope
POSIX 1003.1c V1
Contention Scope
RW_THR_PROCESS_SCOPE PTHREAD_SCOPE_PROCESS
RW_THR_SYSTEM_SCOPE PTHREAD_SCOPE_SYSTEM

6.4.1.3 Scheduling Inheritance Policy

The scheduling inheritance policy attribute is fully supported by the OSF/1 implementation of Threads.h++ and defaults to RW_THR_INHERIT.

6.4.1.4 Concurrency Policy

The concurrency policy attribute is not supported in the OSF/1 implementation of Threads.h++. Attempts to get or set this attribute value will result in exceptions.

6.4.1.5 Scheduling Policy

In POSIX 1003.1c compliant systems, support for the specification of scheduling policy is optional. Threads.h++ determines whether scheduling policy is supported by testing for the definition of the macro _POSIX_THREAD_PRIORITY_SCHEDULING. Even if the API indicates that priority scheduling is supported, the environment may not support all policies.

The OSF/1 4.0d implementation of the POSIX 1003.1c threads API supports all three scheduling policies as defined by the standard:

The Threads.h++ OSF/1 implementation maps its RWSchedulingPolicy values to the underlying POSIX 1003.1c policy values as follows:

Table 16 -- OSF/1 using POSIX 1003.1c V1: Mapping of RWSchedulingPolicy to POSIX 1003.1c V1 values

Threads.h++
RWSchedulingPolicy
POSIX 1003.1c V1
Scheduling Policy
RW_THR_PREEMPTIVE
SCHED_FIFO
RW_THR_TIME_SLICED_FIXED
SCHED_RR
RW_THR_TIME_SLICED_DYNAMIC
(RW_THR_OTHER may be used to set)
SCHED_OTHER

Attempts to set any other scheduling policy value will result in an RWTHROperationNotAvailable exception.

Note that Threads.h++ has mapped two policy values to the same underlying policy, SCHED_OTHER. Calls to getSchedulingPolicy() will return RW_THR_TIME_SLICED_DYNAMIC since that value gives the most meaningful interpretation.

A new thread's scheduling policy is inherited from the creating thread by default, unless the scheduling policy attribute has been explicitly set or the inheritance policy has been changed from its default value of RW_THR_INHERIT to RW_THR_EXPLICIT. If the inheritance policy is RW_THR_INHERIT, and you query for the default policy, Threads.h++ will return the scheduling policy used by the calling thread. If the inheritance policy is RW_THR_EXPLICIT, Threads.h++ defines the default scheduling policy to be RW_THR_TIME_SLICED_DYNAMIC.

6.4.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 OSF/1 version 4.0f implementation does support priority scheduling. Threads.h++ uses the POSIX.4 functions sched_get_priority_min() and sched_get_priority_max() to determine the legal range of priority values. Under this implementation, the priorities vary by scheduling policy as shown in the following table:

Table 17 -- OSF/1 using POSIX 1003.1c V1: Scheduling priority values determined with POSIX.4 functions sched_get_priority_min() and sched_get_priority_max()

Scheduling PolicyMinimum
Priority
Maximum
Priority
Default
Priority
RW_THR_PREEMPTIVE
0
63
19
RW_THR_TIME_SLICED_FIXED
0
63
19
RW_THR_TIME_SLICED_DYNAMIC
0
63
19

A new thread's priority value is inherited from the creating thread by default, unless the priority attribute has been explicitly set or the inheritance policy has been changed from its default value of RW_THR_INHERIT to RW_THR_EXPLICIT. If the inheritance policy is RW_THR_INHERIT, and you query for the default priority, Threads.h++ will return the priority of the calling thread. If the inheritance policy is RW_THR_EXPLICIT, Threads.h++ defines the default priority in accordance with the values listed in the table above.

6.4.1.7 Scheduling Time-Slice Quantum

The time-slice quantum attribute is not supported in the OSF/1 implementation of Threads.h++. Attempts to get or set this attribute value will result in exceptions.

6.4.2 Stack Attributes

In POSIX 1003.1c-compliant systems, support for user specification of stack attributes is optional. OSF/1 supports size control for a system-managed stack, but does not support user-managed stacks.

6.4.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.

6.4.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 OSF/1 4.0d implementation does not support user-defined stacks; any attempts to get or set the user stack address and size attributes will result in exceptions.



Previous fileTop of DocumentContentsIndexNext file

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