Email List: Xaustin-review-lX
[All Lists]

Re: Defect in XSH pthread_attr_getschedpolicy()

To: yyyyyyy@xxxxxxxxxx
Subject: Re: Defect in XSH pthread_attr_getschedpolicy()
From: Dave Butenhof <yyyyyyyyyyyyyy@xxxxxx>
Date: Thu, 13 Feb 2003 06:41:41 -0500
Cc: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
Organization: Hewlett-Packard Company
References: <200302130910.JAA02455@xxxxxx>
yyyyyyy@xxxxxxxxxx wrote:

Defect report from : Ulrich Drepper , Red Hat

(Please direct followup comments direct to yyyyyyyyyyyyyy@xxxxxxxxxxxxx)

@ page 989 line 31443 section pthread_attr_getschedpolicy() objection {ptattr-2}

Problem:

Defect code : 2. Omission

The standard does not mention anywhere the default value of the value retrieved via pthread_attr_getschedpolicy() after a call to
pthread_attr_init().

The pthread_attr_getguardsize() man page does contain the appropriate information.

I would guess the default value is SCHED_OTHER.

Action:

Add new paragraph after line 31442:

The default value of the /schedpolicy/ attribute is <t>SCHED_OTHER<t>

Again, this is a scheduling attribute, where a single default would not be appropriate both for an embedded realtime system and for a multiuser timeshare system. The default values were intended to be implementation defined.

Like many parts of POSIX, this is a compromise position. Like all good compromises, it has the essential attribute that each side knows the other sides are just as uncomfortable with the result as they are. ;-)

But then, another way to look at it is that most applications don't need to worry about this at all. The implementation should choose defaults that support its normal policies. On a multiuser timeshare system, the default should clearly be a timeshare policy (unspecified by POSIX!) with a priority that contends fairly with other processes and threads on the system. Most applications will never need anything else. And if they do, they'd almost certainly need to set it manually anyway.

--
/--------------------[ yyyyyyyyyyyyyy@xxxxxx ]--------------------\
| Hewlett-Packard Company Tru64 UNIX & VMS Thread Architect |
| My book: http://www.awl.com/cseng/titles/0-201-63392-2/ |
\----[ http://homepage.mac.com/dbutenhof/Threads/Threads.html ]---/


<Prev in Thread] Current Thread [Next in Thread>