Defect Report concerning: IEEE Std. 1003.1c-1995, ISO/IEC 9945-1:1990 AMD 2 - Threads
Clause: 13.5.1.2
PASC Interpretation Ref: pasc-1003.1c-30
Topic: Thread Scheduling Functions, Description


This is an unapproved interpretation of PASC 1003.1c-1995, ISO/IEC 9945-1:1990 AMD 2 - Threads.

Use of the information contained in this unapproved document is at your own risk.

Last update: 30 March,1998


								1003.1c-95  #30

 _____________________________________________________________________________

	Interpretation Number:	30
	Topic:               Thread Scheduling Functions, Description
	Relevant Sections:   13.5.1.2 

Interpretation Request: (Defect Report)
-----------------------

	Date: Tue, 27 Aug 1996 15:27:10 -0400
	From: Dave Butenhof <butenhof@zko.dec.com>
        Standard: 9945-1:1996 (1003.1, 1996 Edition)


4. Section 13.5.1.2, Thread Scheduling Functions, Description

   The standard currently requires that the pthread_attr_setschedparam and
   pthread_attr_getschedparam functions be present if {_POSIX_THREADS} is
   defined, while all other thread scheduling attribute functions are
   present if {_POSIX_THREAD_PRIORITY_SCHEDULING} is defined. It is
   pointless to have pthread_attr_setschedparam without also having
   pthread_attr_setpolicy and pthread_attr_setinheritsched, for
   example. The rationale for this section (B.13.1) makes clear the
   original intent of the working group -- "In this standard, the basic
   thread scheduling functions are defined under the {_POSIX_THREADS}
   option so that they are required of all threads
   implementations. However, there are no specific scheduling policies
   required by this option to allow for conforming thread implementations
   that are not targeted to realtime applications."

   Although it is understood that rationale (however clearly following the
   intent of the working group) is not normative or binding, it is not
   reasonable that all thread implementations support "scheduling
   parameters" but not scheduling policy, or the other mechanism that gives
   scheduling parameters meaning. The standard must be repaired to, at
   least, restore consistency. While the best policy would be to follow the
   intent of the working group, and make all of the scheduling-related
   functions available if {_POSIX_THREADS}, it would be acceptable to make
   them all available only if {_POSIX_THREAD_PRIORITY_SCHEDULING}.

        REF:    pages 300-301, section 13.5.1.2, lines 509, 552
                page 303, section 13.5.2.2, line 599
                page 548, section B.13.1, lines 7897-7901


Interpretation response
------------------------


The standard is clear that on p. 300, line 509,
_POSIX_THREAD_PRIORITY_SCHEDULING} is defined then
the functions:
    pthread_attr_setscope(), pthread_attr_getscope(),
    pthread_attr_setinheritsched(), pthread_attr_getinheritsched(),
    pthread_attr_setschedpolicy(), pthread_attr_getschedpolicy()
shall be provided.

It is also clear on page 301, line 552, that if _POSIX_THREADS is
defined then the functions:
    pthread_attr_setschedparam() and pthread_attr_getschedparam()
shall be provided.  Conforming implementations must conform to these. 

Rationale
-------------

None.

Forwarded to Interpretations group: August 29 1996
Finalised : 27 Mar 1997